MCPcopy Index your code
hub / github.com/conwnet/github1s / escapeRegexp

Function escapeRegexp

extensions/github1s/src/adapters/sourcegraph/common.ts:62–62  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

60};
61
62export const escapeRegexp = (text: string): string => text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
63
64export const buildRepoPattern = (repo: string) => {
65 return `^${escapeRegexp(repo)}$`;

Callers 3

getSymbolPositionsFunction · 0.90
buildRepoPatternFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected