({ pattern, path, include }: SearchInput)
| 29 | } |
| 30 | |
| 31 | function 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 |
no test coverage detected