Skip to content

Commit

Permalink
feat(module): supports object exports
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcdo29 committed Aug 9, 2020
1 parent c44a82f commit 66a21ef
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/debug.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,16 @@ export class DebugModule {
controllers.push(...debuggedControllers);
exports.push(
...modRef.exports.map((exp) => ({
name: typeof exp === 'function' ? exp.name : exp.toString(),
name:
typeof exp === 'function'
? exp.name
: // export is an object, not a string or class
typeof exp === 'object'
? // object uses a class export
((exp as CustomProvider).provide as Type<any>).name ||
// object uses a string/symbol export
(exp as CustomProvider).provide.toString()
: exp.toString(),
type: this.exportType(exp as any),
})),
);
Expand Down

0 comments on commit 66a21ef

Please sign in to comment.