MCPcopy
hub / github.com/nestjs/nest / scan

Method scan

packages/core/scanner.ts:86–104  ·  view source on GitHub ↗
(
    module: Type<any>,
    options?: { overrides?: ModuleOverride[] },
  )

Source from the content-addressed store, hash-verified

84 ) {}
85
86 public async scan(
87 module: Type<any>,
88 options?: { overrides?: ModuleOverride[] },
89 ) {
90 await this.registerCoreModule(options?.overrides);
91 await this.scanForModules({
92 moduleDefinition: module,
93 overrides: options?.overrides,
94 });
95 await this.scanModulesForDependencies();
96 this.addScopedEnhancersMetadata();
97
98 // Modules distance calculation should be done after all modules are scanned
99 // but before global modules are registered (linked to all modules).
100 // Global modules have their distance set to MAX anyway.
101 this.calculateModulesDistance();
102
103 this.container.bindGlobalScope();
104 }
105
106 public async scanForModules({
107 moduleDefinition,

Callers 3

initializeMethod · 0.95
compileMethod · 0.95
scanner.spec.tsFile · 0.80

Calls 6

registerCoreModuleMethod · 0.95
scanForModulesMethod · 0.95
bindGlobalScopeMethod · 0.80

Tested by

no test coverage detected