* The text of the call chain starting at `at` — `({ … })`, and any `.update({ … })` * or `.lazy(…)` after it, which is where a route's component may be written.
(s: string, at: number)
| 260 | * or `.lazy(…)` after it, which is where a route's component may be written. |
| 261 | */ |
| 262 | function chainAfter(s: string, at: number): string { |
| 263 | let i = at; |
| 264 | const start = i; |
| 265 | for (let steps = 0; steps < 8; steps++) { |
| 266 | while (i < s.length && /\s/.test(s[i]!)) i++; |
| 267 | if (s[i] === '.') { |
| 268 | i++; |
| 269 | while (i < s.length && /[\w$]/.test(s[i]!)) i++; |
| 270 | while (i < s.length && /\s/.test(s[i]!)) i++; |
| 271 | } |
| 272 | if (s[i] !== '(') break; |
| 273 | const close = matchBracket(s, i); |
| 274 | if (close < 0) break; |
| 275 | i = close + 1; |
| 276 | } |
| 277 | return s.slice(start, i); |
| 278 | } |
| 279 | |
| 280 | /** The component a route names: an identifier, or the file a lazy import names. */ |
| 281 | function componentIn(text: string): string | null { |
no test coverage detected