MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / getOrAddString

Function getOrAddString

front_end/testing/SourceMapEncoder.ts:124–131  ·  view source on GitHub ↗
(array: string[], s: string)

Source from the content-addressed store, hash-verified

122 return sourceMapV3;
123
124 function getOrAddString(array: string[], s: string) {
125 const index = array.indexOf(s);
126 if (index >= 0) {
127 return index;
128 }
129 array.push(s);
130 return array.length - 1;
131 }
132}
133
134export function waitForAllSourceMapsProcessed(): Promise<unknown> {

Callers 1

encodeSourceMapFunction · 0.85

Calls 2

indexOfMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected