Function fromNullable

  • Either constructor from optional or nullable value

    Resolves to 'left error' in case of undefined or null value and 'right value' otherwise

    Type Parameters

    • L

    Parameters

    • value: undefined

      possibly undefined or nullable value

    • error: L

      error to use in case of undefined or nullable value

    Returns Left<never, L>

    either 'right value' or 'left error'

  • Type Parameters

    • L

    Parameters

    • value: null
    • error: L

    Returns Left<never, L>

  • Type Parameters

    • R

    Parameters

    • value: Exclude<R, undefined | null>
    • error: unknown

    Returns Right<R, never>

  • Type Parameters

    • R

    • L

    Parameters

    • value: undefined | null | R
    • error: L

    Returns Either<R, L>

Generated using TypeDoc