Skip to content

Commit

Permalink
bugfix(core): add missing isSymbol check
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Feb 21, 2019
1 parent b89651f commit 40fb55a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/core/errors/messages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Type } from '@nestjs/common';
import { isNil } from '@nestjs/common/utils/shared.utils';
import { isNil, isSymbol } from '@nestjs/common/utils/shared.utils';
import {
InjectorDependency,
InjectorDependencyContext,
Expand All @@ -21,11 +21,13 @@ const getInstanceName = (instance: any) =>
* @param dependency The dependency whichs name should get displayed
*/
const getDependencyName = (dependency: InjectorDependency) =>
// Use class name
// use class name
getInstanceName(dependency) ||
// Use injection token
dependency && dependency.toString() ||
// Don't know, don't care
// use injection token (symbol)
(isSymbol(dependency) && dependency.toString()) ||
// use string directly
dependency ||
// otherwise
'+';

/**
Expand Down

0 comments on commit 40fb55a

Please sign in to comment.