MCPcopy
hub / github.com/microsoft/vscode-js-debug / occurencesInString

Function occurencesInString

src/targets/sourceMapOverrides.ts:15–19  ·  view source on GitHub ↗
(re: RegExp, str: string)

Source from the content-addressed store, hash-verified

13const nonCapturingGroupRe = new RegExp(escapeRegexSpecialChars(nonCapturingGroup), 'g');
14
15const occurencesInString = (re: RegExp, str: string) => {
16 const matches = str.match(re);
17 re.lastIndex = 0;
18 return matches ? matches.length : 0;
19};
20
21const anyGroupRe = new RegExp(
22 `${escapeRegexSpecialChars(nonCapturingGroup)}|${escapeRegexSpecialChars(capturingGroup)}`,

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected