Fix compile and bundle api types (#3703)

This commit is contained in:
Klaus Hvam 2020-01-17 23:45:18 +01:00 committed by Ry Dahl
parent aedf8721cf
commit 35eb79610f
3 changed files with 7 additions and 6 deletions

View file

@ -240,9 +240,10 @@ self.compilerMain = function compilerMain(): void {
emitResult.emitSkipped === false,
"Unexpected skip of the emit."
);
const { items } = fromTypeScriptDiagnostic(diagnostics);
const result = [
items && items.length ? items : undefined,
diagnostics.length
? fromTypeScriptDiagnostic(diagnostics)
: undefined,
bundle ? state.emitBundle : state.emitMap
];
postMessage(result);