* The distinct node names, in getAllNodeNames order, and the same * names lowercased and newline-joined: name `i` lowercased is * `lowered.slice(starts[i], starts[i + 1] - 1)`. Read once until the * database changes (fresh inside a transaction). The fuzzy fallback compares * agai
()
| 4621 | * against it, and the LIKE fallback asks it whether any name holds a word. |
| 4622 | */ |
| 4623 | private fuzzyNames(): { names: string[]; lowered: string; starts: Int32Array } { |
| 4624 | const read = (): { names: string[]; lowered: string; starts: Int32Array } => { |
| 4625 | const names = this.getAllNodeNames(); |
| 4626 | const lowered = names.map((name) => name.toLowerCase()); |
| 4627 | const starts = new Int32Array(names.length + 1); |
| 4628 | for (let i = 0; i < lowered.length; i++) starts[i + 1] = starts[i]! + lowered[i]!.length + 1; |
| 4629 | return { names, lowered: lowered.join('\n') + '\n', starts }; |
| 4630 | }; |
| 4631 | return this.memoizedRead('fuzzyNames', read) ?? read(); |
| 4632 | } |
| 4633 | |
| 4634 | /** |
| 4635 | * The distinct file paths of the nodes, lowercased and newline-joined. Read |
no test coverage detected