MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / escapeRegExp

Function escapeRegExp

src/utils.ts:439–442  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

437 * is read as pattern syntax and may not compile at all.
438 */
439export function escapeRegExp(text: string): string {
440 // Most text here is an identifier, with nothing to escape.
441 return REGEXP_SYNTAX.test(text) ? text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') : text;
442}
443
444/**
445 * An empty lock file younger than this is still being written by the process

Callers 15

isJsSuperCallSiteFunction · 0.90
fieldChannelEdgesFunction · 0.90
ownLinesBindFunction · 0.90
constantEventNameFunction · 0.90
fitsWithTypeParametersFunction · 0.90
csharpParameterListFunction · 0.90
flagFunction · 0.90
isDefinedInFunction · 0.90
readLiteralFunction · 0.90
scalaMemberInScopeFunction · 0.90
writtenNameFunction · 0.90
constantTextFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected