Function fromOptional

  • Maybe constructor from optional value

    Resolves to 'nothing' in case of undefined value and 'just value' otherwise

    Parameters

    • value: undefined

      possibly undefined value

    Returns Nothing<never>

    either 'just value' or 'nothing'

  • Type Parameters

    • R

    Parameters

    • value: Exclude<R, undefined>

    Returns Just<R>

  • Type Parameters

    • R

    Parameters

    • value: undefined | R

    Returns Maybe<R>

Generated using TypeDoc