Skip to content

Commit

Permalink
fix(core): filter out undefined values in get all and merge
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed May 28, 2020
1 parent 486a40b commit b8ce412
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/services/reflector.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export class Reflector {
metadataKey: TKey,
targets: (Type<any> | Function)[],
): TResult {
const metadataCollection = this.getAll(metadataKey, targets);
const metadataCollection = this.getAll(metadataKey, targets).filter(
item => item !== undefined,
);
return metadataCollection.reduce((a, b) => {
if (Array.isArray(a)) {
return a.concat(b);
Expand Down

0 comments on commit b8ce412

Please sign in to comment.