A parameter's binding pattern, without its type or default: `{ default: Page }` of `{ default: Page }: Module`.
(param: string)
| 1695 | |
| 1696 | /** A parameter's binding pattern, without its type or default: `{ default: Page }` of `{ default: Page }: Module`. */ |
| 1697 | function parameterPattern(param: string): string { |
| 1698 | param = param.replace(/^\.\.\.\s*/, ''); |
| 1699 | if (param.startsWith('{') || param.startsWith('[')) { |
| 1700 | const close = matchBracket(param, 0); |
| 1701 | return close < 0 ? '' : param.slice(0, close + 1); |
| 1702 | } |
| 1703 | return /^[A-Za-z_$][\w$]*/.exec(param)?.[0] ?? ''; |
| 1704 | } |
| 1705 | |
| 1706 | /** |
| 1707 | * The value a function body hands back from its first top-level `return`, |
no test coverage detected