MCPcopy
hub / github.com/andremichelle/openDAW / removeValueIf

Method removeValueIf

packages/lib/std/src/multimap.ts:112–123  ·  view source on GitHub ↗
(predicate: Predicate<V>)

Source from the content-addressed store, hash-verified

110 }
111
112 removeValueIf(predicate: Predicate<V>): ReadonlySet<V> {
113 const removeList: [K, V][] = []
114 for (const [key, values] of this.#map.entries()) {
115 for (const value of values.filter(value => predicate(value))) {
116 removeList.push([key, value])
117 }
118 }
119 for (const [key, value] of removeList) {
120 this.remove(key, value)
121 }
122 return new Set(removeList.map(([, value]) => value))
123 }
124
125 removeKey(key: K): ReadonlyArray<V> {
126 const values = this.#map.get(key)

Callers

nothing calls this directly

Calls 4

removeMethod · 0.95
entriesMethod · 0.65
filterMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected