(query: string, text: string)
| 1640 | } |
| 1641 | |
| 1642 | function firstMatchColumn(query: string, text: string): number { |
| 1643 | const q = query.trim().toLowerCase() |
| 1644 | const t = text.toLowerCase() |
| 1645 | const direct = t.indexOf(q) |
| 1646 | if (direct >= 0) return direct |
| 1647 | |
| 1648 | let qi = 0 |
| 1649 | let start = -1 |
| 1650 | for (let i = 0; i < t.length && qi < q.length; i++) { |
| 1651 | if (t[i] !== q[qi]) continue |
| 1652 | if (start === -1) start = i |
| 1653 | qi++ |
| 1654 | } |
| 1655 | return start >= 0 ? start : 0 |
| 1656 | } |
| 1657 | |
| 1658 | function collapseSearchLine(line: string): string { |
| 1659 | return line.replace(/\s+/g, ' ').trim() |
no outgoing calls
no test coverage detected