* Strip a surrounding pair of double quotes from `s`. Allows users to * keep whitespace in path filters: `path:"my dir/file"`.
(s: string)
| 55 | * keep whitespace in path filters: `path:"my dir/file"`. |
| 56 | */ |
| 57 | function unquote(s: string): string { |
| 58 | if (s.length >= 2 && s.startsWith('"') && s.endsWith('"')) return s.slice(1, -1); |
| 59 | return s; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Parse a raw query into structured filters + remaining text. |