The offset of the `>` closing the `<` at `at`, or -1. `->` and `=>` close nothing.
(code: string, at: number, limit = code.length)
| 204 | |
| 205 | /** The offset of the `>` closing the `<` at `at`, or -1. `->` and `=>` close nothing. */ |
| 206 | function angleClose(code: string, at: number, limit = code.length): number { |
| 207 | let depth = 0; |
| 208 | for (let i = at; i < limit; i++) { |
| 209 | const c = code[i]; |
| 210 | if (c === '<') depth++; |
| 211 | else if (c === '>' && code[i - 1] !== '-' && code[i - 1] !== '=') { |
| 212 | if (--depth === 0) return i; |
| 213 | } else if (c === ';' || c === '{' || c === '}') return -1; |
| 214 | } |
| 215 | return -1; |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * Walk `code` from `from` to `to` over what lies outside brackets: `stop` |
no outgoing calls
no test coverage detected