From dd0f4f1b88db89cb6e148b129ca30642e2ea1b0a Mon Sep 17 00:00:00 2001 From: Victor Didenko Date: Tue, 28 Aug 2018 17:18:36 +0300 Subject: [PATCH] fix: always filter out definition files 26 --- lib/Mapper.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Mapper.ts b/lib/Mapper.ts index 29555bd..8236c53 100644 --- a/lib/Mapper.ts +++ b/lib/Mapper.ts @@ -51,12 +51,12 @@ export default class Mapper { } async *files(): AsyncIterableIterator { - const { options } = this.parsed; - yield* this.parsed.fileNames - .filter(path => options.declaration || !path.endsWith('.d.ts')) - .map(path => new EsFile({ path, options, config: this.parsed })); + const config = this.parsed; + const { options, fileNames } = config; + const files = fileNames.filter(n => !n.endsWith('.d.ts')); + yield* files.map(path => new EsFile({ path, options, config })); if (options.declaration) { - yield* this.parsed.fileNames.map(path => new TsFile({ path, options, config: this.parsed })); + yield* files.map(path => new TsFile({ path, options, config })); } }