From 62aedfe3e3f2de4f493e2aa5a03f6f57bc35edef Mon Sep 17 00:00:00 2001 From: Eugene Zolenko Date: Wed, 28 Mar 2018 10:23:26 -0600 Subject: [PATCH] - fix for formatting --- src/index.ts | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9729380..9ad92c5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -242,19 +242,22 @@ export default function typescript(options?: Partial) printDiagnostics(contextWrapper, diagnostics, parsedConfig.options.pretty === true); } - if (result && result.dts) + if (result) { - const key = normalize(id); - declarations[key] = result.dts; - context.debug(() => `${blue("generated declarations")} for '${key}'`); - result.dts = undefined; - } - - if (result && result.map) { - if (pluginOptions.sourceMapCallback) { - pluginOptions.sourceMapCallback(id, result.map); + if (result.dts) + { + const key = normalize(id); + declarations[key] = result.dts; + context.debug(() => `${blue("generated declarations")} for '${key}'`); + result.dts = undefined; + } + + if (result.map) + { + if (pluginOptions.sourceMapCallback) + pluginOptions.sourceMapCallback(id, result.map); + result.map = JSON.parse(result.map); } - result.map = JSON.parse(result.map); } return result;