plainfp - v0.1.0
    Preparing search index...

    Function filter

    • Keep only entries for which predicate returns true. Result is typed Partial since keys may be absent.

      Dual API — works data-first or curried for use in pipe.

      Type Parameters

      • K extends PropertyKey
      • V

      Parameters

      • record: Readonly<Record<K, V>>
      • predicate: (value: V, key: K) => boolean

      Returns Partial<Record<K, V>>

      pipe(
      { a: 1, b: 2, c: 3 },
      Records.filter((v) => v % 2 === 1),
      )
      // { a: 1, c: 3 }
    • Keep only entries for which predicate returns true. Result is typed Partial since keys may be absent.

      Dual API — works data-first or curried for use in pipe.

      Type Parameters

      • K extends PropertyKey
      • V

      Parameters

      • predicate: (value: V, key: K) => boolean

      Returns (record: Readonly<Record<K, V>>) => Partial<Record<K, V>>

      pipe(
      { a: 1, b: 2, c: 3 },
      Records.filter((v) => v % 2 === 1),
      )
      // { a: 1, c: 3 }