Skip to content

Commit 62aedfe

Browse files
committed
- fix for formatting
1 parent ffb2c0d commit 62aedfe

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/index.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -242,19 +242,22 @@ export default function typescript(options?: Partial<IOptions>)
242242
printDiagnostics(contextWrapper, diagnostics, parsedConfig.options.pretty === true);
243243
}
244244

245-
if (result && result.dts)
245+
if (result)
246246
{
247-
const key = normalize(id);
248-
declarations[key] = result.dts;
249-
context.debug(() => `${blue("generated declarations")} for '${key}'`);
250-
result.dts = undefined;
251-
}
247+
if (result.dts)
248+
{
249+
const key = normalize(id);
250+
declarations[key] = result.dts;
251+
context.debug(() => `${blue("generated declarations")} for '${key}'`);
252+
result.dts = undefined;
253+
}
252254

253-
if (result && result.map) {
254-
if (pluginOptions.sourceMapCallback) {
255-
pluginOptions.sourceMapCallback(id, result.map);
255+
if (result.map)
256+
{
257+
if (pluginOptions.sourceMapCallback)
258+
pluginOptions.sourceMapCallback(id, result.map);
259+
result.map = JSON.parse(result.map);
256260
}
257-
result.map = JSON.parse(result.map);
258261
}
259262

260263
return result;

0 commit comments

Comments
 (0)