MCPcopy Create free account
hub / github.com/nodejs/node / removeHtmlElementFromMapIf

Function removeHtmlElementFromMapIf

deps/v8/tools/turbolizer/src/views/text-view.ts:201–214  ·  view source on GitHub ↗
(condition: (e: HTMLElement) => boolean,
                                     map: Map<string, Array<HTMLElement>>)

Source from the content-addressed store, hash-verified

199 public onresize(): void {}
200
201 private removeHtmlElementFromMapIf(condition: (e: HTMLElement) => boolean,
202 map: Map<string, Array<HTMLElement>>): void {
203 for (const [nodeId, elements] of map) {
204 let i = elements.length;
205 while (i--) {
206 if (condition(elements[i])) {
207 elements.splice(i, 1);
208 }
209 }
210 if (elements.length == 0) {
211 map.delete(nodeId);
212 }
213 }
214 }
215
216 public removeHtmlElementFromAllMapsIf(condition: (e: HTMLElement) => boolean): void {
217 this.clearSelection();

Callers

nothing calls this directly

Calls 2

deleteMethod · 0.65
conditionFunction · 0.50

Tested by

no test coverage detected