Function optEmptyArray

  • For empty array ([]) returns None, otherwise acts same as opt.

    Type Parameters

    • T

    • A extends readonly T[] | T[]

    Parameters

    • x: undefined | null | A

    Returns OptSafe<A>

    Example

    optEmptyArray(undefined) // None
    optEmptyArray([]) // None
    optEmptyArray([1]) // Some([1])

Generated using TypeDoc