MCPcopy Create free account
hub / github.com/Rich-Harris/magic-string / matchAll

Method matchAll

src/MagicString.ts:1217–1227  ·  view source on GitHub ↗
(re: RegExp, str: string)

Source from the content-addressed store, hash-verified

1215 }
1216 }
1217 function matchAll(re: RegExp, str: string): RegExpExecArray[] {
1218 const matches = []
1219 while (true) {
1220 const match = re.exec(str)
1221 if (!match)
1222 break
1223
1224 matches.push(match)
1225 }
1226 return matches
1227 }
1228 if (searchValue.global) {
1229 const matches = matchAll(searchValue, this.original)
1230 matches.forEach((match) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected