better-returns
    Preparing search index...

    Function map

    • Maps the value of a 'some' Option using a predicate function. If the Option is 'none', it returns a 'none' Option.

      Type Parameters

      • T
      • U

      Parameters

      • option: Option<T>

        The Option to map.

      • predicate: (value: T) => U

        The function to apply to the value if the option is 'some'.

      Returns Option<U>

      A new Option with the mapped value, or a 'none' Option.