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

Function buildZoektQuery

packages/web/tools/globToRegexpPlayground.ts:31–43  ·  view source on GitHub ↗
({ pattern, path, include }: SearchInput)

Source from the content-addressed store, hash-verified

29}
30
31function buildZoektQuery({ pattern, path, include }: SearchInput): string {
32 const parts: string[] = [`"${pattern.replace(/"/g, '\\"')}"`];
33
34 if (path) {
35 parts.push(`file:${escapeStringRegexp(path)}`);
36 }
37
38 if (include) {
39 parts.push(`file:${globToFileRegexp(include)}`);
40 }
41
42 return parts.join(' ');
43}
44
45// -------------------------------------------------------
46// Examples

Callers 1

Calls 1

globToFileRegexpFunction · 0.70

Tested by

no test coverage detected