Where the first `=>` outside brackets and strings is in `text`, or -1.
(text: string)
| 1680 | |
| 1681 | /** Where the first `=>` outside brackets and strings is in `text`, or -1. */ |
| 1682 | function arrowAt(text: string): number { |
| 1683 | for (let i = 0; i < text.length; i++) { |
| 1684 | const ch = text[i]!; |
| 1685 | if (ch === '"' || ch === "'" || ch === '`') { |
| 1686 | i = skipString(text, i); |
| 1687 | if (i < 0) return -1; |
| 1688 | } else if (ch === '{' || ch === '(' || ch === '[') { |
| 1689 | i = matchBracket(text, i); |
| 1690 | if (i < 0) return -1; |
| 1691 | } else if (ch === '=' && text[i + 1] === '>') return i; |
| 1692 | } |
| 1693 | return -1; |
| 1694 | } |
| 1695 | |
| 1696 | /** A parameter's binding pattern, without its type or default: `{ default: Page }` of `{ default: Page }: Module`. */ |
| 1697 | function parameterPattern(param: string): string { |
no test coverage detected