Skip to content

Commit

Permalink
combine unused filter
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored and lukastaegert committed Apr 16, 2018
1 parent 3e8cdda commit a449dd7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/ExternalModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,11 @@ export default class ExternalModule {
}

warnUnusedImports() {
const unused = Object.keys(this.declarations)
.filter(name => name !== '*')
.filter(name => {
const declaration = this.declarations[name];
return !declaration.included && !this.reexported && !declaration.referenced;
});
const unused = Object.keys(this.declarations).filter(name => {
if (name === '*') return false;
const declaration = this.declarations[name];
return !declaration.included && !this.reexported && !declaration.referenced;
});

if (unused.length === 0) return;

Expand Down

0 comments on commit a449dd7

Please sign in to comment.