Skip to content

Commit fece41a

Browse files
author
Patrick Housley
committed
fix(@nestjs/core) application context, support symbol
Update application context to support retrieving a module using a symbol. The injector already supports the use of symbols when declaring modules for DI.
1 parent 853c3c9 commit fece41a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/core/nest-application-context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ export class NestApplicationContext implements INestApplicationContext {
2626
: null;
2727
}
2828

29-
public get<T>(metatypeOrToken: Metatype<T> | string): T {
29+
public get<T>(metatypeOrToken: Metatype<T> | string | symbol): T {
3030
return this.findInstanceByPrototypeOrToken<T>(metatypeOrToken);
3131
}
3232

33-
private findInstanceByPrototypeOrToken<T>(metatypeOrToken: Metatype<T> | string) {
33+
private findInstanceByPrototypeOrToken<T>(metatypeOrToken: Metatype<T> | string | symbol) {
3434
const dependencies = new Map([
3535
...this.contextModule.components,
3636
...this.contextModule.routes,

0 commit comments

Comments
 (0)