Skip to content

filter

filter<A>(predicate): <K>(m) => ReadonlyMap<K, A>

Defined in: Utils/Dict.ts:277

Returns a new dictionary containing only the entries for which the predicate returns true.

A

(a) => boolean

<K>(m): ReadonlyMap<K, A>

K

ReadonlyMap<K, A>

ReadonlyMap<K, A>

pipe(Dict.fromEntries([["a", 1], ["b", 3], ["c", 0]]), Dict.filter(n => n > 0));
// ReadonlyMap { "a" => 1, "b" => 3 }