Where the first `=>` outside brackets and strings is in `text`, or -1.
(text: string)
| 1702 | |
| 1703 | /** Where the first `=>` outside brackets and strings is in `text`, or -1. */ |
| 1704 | function arrowAt(text: string): number { |
| 1705 | for (let i = 0; i < text.length; i++) { |
| 1706 | const ch = text[i]!; |
| 1707 | if (ch === '"' || ch === "'" || ch === '`') { |
| 1708 | i = skipString(text, i); |
| 1709 | if (i < 0) return -1; |
| 1710 | } else if (ch === '{' || ch === '(' || ch === '[') { |
| 1711 | i = matchBracket(text, i); |
| 1712 | if (i < 0) return -1; |
| 1713 | } else if (ch === '=' && text[i + 1] === '>') return i; |
| 1714 | } |
| 1715 | return -1; |
| 1716 | } |
| 1717 | |
| 1718 | /** A parameter's binding pattern, without its type or default: `{ default: Page }` of `{ default: Page }: Module`. */ |
| 1719 | function parameterPattern(param: string): string { |
no test coverage detected