De-dupe preserving order.
(xs: string[])
| 11 | |
| 12 | /** De-dupe preserving order. */ |
| 13 | function dedupe(xs: string[]): string[] { |
| 14 | const seen = new Set<string>(); |
| 15 | const out: string[] = []; |
| 16 | for (const x of xs) { if (!seen.has(x)) { seen.add(x); out.push(x); } } |
| 17 | return out; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Turn free-text into a safe FTS5 MATCH expression: each token is double-quoted (neutralizing |
no test coverage detected