Skip to content

Commit

Permalink
fix(util): remove extra filtering when getting directive IO
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Malkevich committed May 21, 2019
1 parent 65bbfd1 commit ebbaba7
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions projects/ngx-testing/src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,13 @@ function filterPropMeta(
obj: PropMetadata,
type: 'Input' | 'Output',
): IOMetadata {
return Object.keys(obj)
.filter(k => obj[k].some(meta => meta.ngMetadataName === type))
.reduce(
(acc, k) => {
const meta = obj[k].find(m => m.ngMetadataName === type);
return meta ? { ...acc, [k]: meta } : acc;
},
{} as IOMetadata,
);
return Object.keys(obj).reduce(
(acc, k) => {
const meta = obj[k].find(m => m.ngMetadataName === type);
return meta ? { ...acc, [k]: meta } : acc;
},
{} as IOMetadata,
);
}

/**
Expand Down

0 comments on commit ebbaba7

Please sign in to comment.