( module: SourceModule, name: string )
| 3553 | |
| 3554 | // e.g. `type Schemas = { user: Type }`, unless the module declares two |
| 3555 | private localTypeOf( |
| 3556 | module: SourceModule, |
| 3557 | name: string |
| 3558 | ): LocalType | undefined { |
| 3559 | let types = this.localTypesByModule.get(module) |
| 3560 | if (!types) { |
| 3561 | const found: Record<string, LocalType | null> = Object.create(null) |
| 3562 | walk(module.program, node => { |
| 3563 | if ( |
| 3564 | node.type === "TSInterfaceDeclaration" || |
| 3565 | node.type === "TSTypeAliasDeclaration" |
| 3566 | ) |
| 3567 | found[node.id.name] = node.id.name in found ? null : node |
| 3568 | return true |
| 3569 | }) |
| 3570 | this.localTypesByModule.set(module, (types = found)) |
| 3571 | } |
| 3572 | return types[name] ?? undefined |
| 3573 | } |
| 3574 | |
| 3575 | // e.g. `f(A)`, `(t => t)(A)` or `new C(A)` for C's constructor; undefined if `f` escapes |
| 3576 | callsOf( |
no test coverage detected