plainfp - v0.1.0
    Preparing search index...

    Function filter

    • Keep the value if predicate holds; otherwise collapse to none. Supports data-first and curried (pipe-friendly) forms.

      Type Parameters

      • T

      Parameters

      Returns OptionType<T>

      const adult = pipe(
      fromNullable(user.age),
      filter((age) => age >= 18),
      )
    • Keep the value if predicate holds; otherwise collapse to none. Supports data-first and curried (pipe-friendly) forms.

      Type Parameters

      • T

      Parameters

      • predicate: (value: T) => boolean

      Returns (option: OptionType<T>) => OptionType<T>

      const adult = pipe(
      fromNullable(user.age),
      filter((age) => age >= 18),
      )