* Walk every `@Module(...)` decorator and populate `out` with * `Controller → enclosingModuleClassName`, based on the decorator's * `controllers: [...]` field and the class declaration that follows the * decorator (skipping stacked decorators and export/default/abstract * modifiers).
(safe: string, out: Map<string, string>)
| 599 | * modifiers). |
| 600 | */ |
| 601 | function collectModuleControllers(safe: string, out: Map<string, string>): void { |
| 602 | for (const hit of findDecorators(safe, ['Module'])) { |
| 603 | const className = classNameAfter(safe, hit.end); |
| 604 | if (!className) continue; |
| 605 | for (const controller of parseControllersField(hit.args)) { |
| 606 | // First-write-wins, same as RouterModule, so a controller listed in two |
| 607 | // modules picks up the one declared earliest in source. |
| 608 | if (!out.has(controller)) out.set(controller, className); |
| 609 | } |
| 610 | } |
| 611 | } |
| 612 | |
| 613 | function parseControllersField(args: string): string[] { |
| 614 | const inner = parseArrayField(args, 'controllers'); |
no test coverage detected