File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Type } from '@nestjs/common' ;
2+ import { Abstract } from '@nestjs/common/interfaces' ;
23import { isFunction } from '@nestjs/common/utils/shared.utils' ;
34import { UnknownElementException } from '../errors/exceptions/unknown-element.exception' ;
45import { InstanceWrapper , NestContainer } from './container' ;
@@ -10,7 +11,7 @@ export class ContainerScanner {
1011 constructor ( private readonly container : NestContainer ) { }
1112
1213 public find < TInput = any , TResult = TInput > (
13- typeOrToken : Type < TInput > | string | symbol ,
14+ typeOrToken : Type < TInput > | Abstract < TInput > | string | symbol ,
1415 ) : TResult {
1516 this . initFlatContainer ( ) ;
1617 return this . findInstanceByPrototypeOrToken < TInput , TResult > (
@@ -20,7 +21,7 @@ export class ContainerScanner {
2021 }
2122
2223 public findInstanceByPrototypeOrToken < TInput = any , TResult = TInput > (
23- metatypeOrToken : Type < TInput > | string | symbol ,
24+ metatypeOrToken : Type < TInput > | Abstract < TInput > | string | symbol ,
2425 contextModule : Partial < Module > ,
2526 ) : TResult {
2627 const dependencies = new Map ( [
Original file line number Diff line number Diff line change 66 OnModuleDestroy ,
77 OnModuleInit ,
88} from '@nestjs/common' ;
9+ import { Abstract } from '@nestjs/common/interfaces' ;
910import { Type } from '@nestjs/common/interfaces/type.interface' ;
1011import { isNil , isUndefined } from '@nestjs/common/utils/shared.utils' ;
1112import iterate from 'iterare' ;
@@ -46,7 +47,7 @@ export class NestApplicationContext implements INestApplicationContext {
4647 }
4748
4849 public get < TInput = any , TResult = TInput > (
49- typeOrToken : Type < TInput > | string | symbol ,
50+ typeOrToken : Type < TInput > | Abstract < TInput > | string | symbol ,
5051 options : { strict : boolean } = { strict : false } ,
5152 ) : TResult {
5253 if ( ! ( options && options . strict ) ) {
@@ -170,7 +171,7 @@ export class NestApplicationContext implements INestApplicationContext {
170171 }
171172
172173 protected find < TInput = any , TResult = TInput > (
173- typeOrToken : Type < TInput > | string | symbol ,
174+ typeOrToken : Type < TInput > | Abstract < TInput > | string | symbol ,
174175 ) : TResult {
175176 return this . containerScanner . find < TInput , TResult > ( typeOrToken ) ;
176177 }
You can’t perform that action at this time.
0 commit comments