ts-utils
    Preparing search index...

    Function isSome

    • Generic TypeGuard against null or undefined values.

      Type Parameters

      • Value

        The type of the value to test.

      Parameters

      • Optionalvalue: null | Value

        The value to test.

      Returns value is NonNullable<Value>

      const maybeValue: string | undefined = "TypeScript";
      isSome(maybeValue)
      // => true
      // typeof maybeValue is string