fix(cli): do not throw on empty typescript files (#8143)

Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
This commit is contained in:
Kitson Kelly 2020-10-27 23:19:27 +11:00 committed by GitHub
parent 30f3b831d3
commit 5af1dcfe29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View file

@ -374,7 +374,10 @@ delete Object.prototype.__proto__;
"op_load",
{ specifier },
);
assert(data, `"data" is unexpectedly null for "${specifier}".`);
assert(
data != null,
`"data" is unexpectedly null for "${specifier}".`,
);
sourceFile = ts.createSourceFile(
specifier,
data,