* The name a module's default export carries: `export default Login`, * `export default function Login`, `export default class Login`, `export * default Login as FC`, or the component a wrapper call hands over — * `observer(Login)`, `React.memo(Login)`, `connect(mapState)(Login)`, * `withTransla
(source: string)
| 627 | * `withTranslation()(withRouter(Login))`. |
| 628 | */ |
| 629 | function defaultExportedName(source: string): string | null { |
| 630 | const at = /\bexport\s+default\s+/.exec(source); |
| 631 | if (!at) return null; |
| 632 | const rest = source.slice(at.index + at[0].length); |
| 633 | const named = /^(?:async\s+)?(?:function\s*\*?\s*|class\s+)([A-Za-z_$][\w$]*)/.exec(rest) ?? |
| 634 | /^([A-Za-z_$][\w$]*)(?:[ \t]*(?:;|\r?\n|$)|\s+(?:as|satisfies)\s)/.exec(rest); |
| 635 | return named ? named[1]! : wrappedName(rest.slice(0, statementEnd(rest, 0))); |
| 636 | } |
| 637 | |
| 638 | /** |
| 639 | * The component a wrapper call hands over — `observer(Login)`, `React.memo(Login)`, |
no test coverage detected