@@ -47,7 +47,7 @@ export class Module {
4747 private readonly _components = new Map < any , InstanceWrapper < Injectable > > ( ) ;
4848 private readonly _injectables = new Map < any , InstanceWrapper < Injectable > > ( ) ;
4949 private readonly _routes = new Map < string , InstanceWrapper < Controller > > ( ) ;
50- private readonly _exports = new Set < string > ( ) ;
50+ private readonly _exports = new Set < string | symbol > ( ) ;
5151
5252 constructor (
5353 private readonly _metatype : Type < any > ,
@@ -82,7 +82,7 @@ export class Module {
8282 return this . _routes ;
8383 }
8484
85- get exports ( ) : Set < string > {
85+ get exports ( ) : Set < string | symbol > {
8686 return this . _exports ;
8787 }
8888
@@ -279,14 +279,14 @@ export class Module {
279279 }
280280
281281 public addExportedComponent (
282- exportedComponent : ComponentMetatype | string | DynamicModule ,
282+ exportedComponent : ComponentMetatype | string | symbol | DynamicModule ,
283283 ) {
284- const addExportedUnit = ( token : string ) =>
284+ const addExportedUnit = ( token : string | symbol ) =>
285285 this . _exports . add ( this . validateExportedProvider ( token ) ) ;
286286
287287 if ( this . isCustomProvider ( exportedComponent as any ) ) {
288288 return this . addCustomExportedComponent ( exportedComponent as any ) ;
289- } else if ( isString ( exportedComponent ) ) {
289+ } else if ( isString ( exportedComponent ) || isSymbol ( exportedComponent ) ) {
290290 return addExportedUnit ( exportedComponent ) ;
291291 } else if ( this . isDynamicModule ( exportedComponent ) ) {
292292 const { module } = exportedComponent ;
@@ -305,7 +305,7 @@ export class Module {
305305 this . _exports . add ( this . validateExportedProvider ( provide . name ) ) ;
306306 }
307307
308- public validateExportedProvider ( token : string ) {
308+ public validateExportedProvider ( token : string | symbol ) {
309309 if ( this . _components . has ( token ) ) {
310310 return token ;
311311 }
@@ -316,7 +316,7 @@ export class Module {
316316 . filter ( metatype => metatype )
317317 . map ( ( { name } ) => name ) ;
318318
319- if ( ! importedRefNames . includes ( token ) ) {
319+ if ( ! importedRefNames . includes ( token as any ) ) {
320320 const { name } = this . metatype ;
321321 throw new UnknownExportException ( name ) ;
322322 }
0 commit comments