MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / globToFileRegexp

Function globToFileRegexp

packages/web/tools/globToRegexpPlayground.ts:17–22  ·  view source on GitHub ↗
(glob: string)

Source from the content-addressed store, hash-verified

15}
16
17function globToFileRegexp(glob: string): string {
18 const re = globToRegexp(glob, { extended: true, globstar: true });
19 // Strip ^ anchor — Sourcebot file paths include the full repo-relative path,
20 // so the pattern shouldn't be anchored to the start.
21 return re.source.replace(/^\^/, '');
22}
23
24function buildRipgrepCommand({ pattern, path, include }: SearchInput): string {
25 const parts = ['rg', `"${pattern.replace(/"/g, '\\"')}"`];

Callers 1

buildZoektQueryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected