Skip to content

filterWithKey

filterWithKey<A>(predicate): (data) => Readonly<Record<string, A>>

Defined in: Utils/Rec.ts:81

Filters values in a record by a predicate that also receives the key.

A

(key, a) => boolean

(data): Readonly<Record<string, A>>

Readonly<Record<string, A>>

Readonly<Record<string, A>>

pipe({ a: 1, b: 2 }, Rec.filterWithKey((k, v) => k !== "a" && v > 0));
// { b: 2 }