Function optionalMap

  • Applies map function to optionalValue if it contains value, otherwise returns undefined

    Type Parameters

    • T

    • U

    Parameters

    • optionalValue: undefined | null | T
    • mapper: ((nonOpt) => U)
        • (nonOpt): U
        • Parameters

          • nonOpt: NonNullable<T>

          Returns U

    Returns U | undefined

  • Applies map function to optionalValue if it contains value, otherwise returns default

    Type Parameters

    • T

    • U

    Parameters

    • optionalValue: undefined | null | T
    • mapper: ((nonOpt) => U)
        • (nonOpt): U
        • Parameters

          • nonOpt: NonNullable<T>

          Returns U

    • defaultValue: U

    Returns U

Generated using TypeDoc