A parameter's binding pattern, without its type or default: `{ default: Page }` of `{ default: Page }: Module`.
(param: string)
| 1717 | |
| 1718 | /** A parameter's binding pattern, without its type or default: `{ default: Page }` of `{ default: Page }: Module`. */ |
| 1719 | function parameterPattern(param: string): string { |
| 1720 | param = param.replace(/^\.\.\.\s*/, ''); |
| 1721 | if (param.startsWith('{') || param.startsWith('[')) { |
| 1722 | const close = matchBracket(param, 0); |
| 1723 | return close < 0 ? '' : param.slice(0, close + 1); |
| 1724 | } |
| 1725 | return /^[A-Za-z_$][\w$]*/.exec(param)?.[0] ?? ''; |
| 1726 | } |
| 1727 | |
| 1728 | /** |
| 1729 | * The value a function body hands back from its first top-level `return`, |
no test coverage detected