Function isSome

  • Generic TypeGuard against null or undefined values.

    Type Parameters

    • Value

      The type of the value to test.

    Parameters

    • Optional value: null | Value

      The value to test.

    Returns value is NonNullable<Value>

    Example

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

Generated using TypeDoc