* 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>)
| 819 | * modifiers). |
| 820 | */ |
| 821 | function collectModuleControllers(safe: string, out: Map<string, string>): void { |
| 822 | for (const hit of findDecorators(safe, ['Module'])) { |
| 823 | const className = classNameAfter(safe, hit.end); |
| 824 | if (!className) continue; |
| 825 | for (const controller of parseControllersField(hit.args)) { |
| 826 | // First-write-wins, same as RouterModule, so a controller listed in two |
| 827 | // modules picks up the one declared earliest in source. |
| 828 | if (!out.has(controller)) out.set(controller, className); |
| 829 | } |
| 830 | } |
| 831 | } |
| 832 | |
| 833 | function parseControllersField(args: string): string[] { |
| 834 | const inner = parseArrayField(args, 'controllers'); |
no test coverage detected