Skip to content

Commit ecf00d6

Browse files
Fixed build
This adds support for type guards in type annotations
1 parent ee5f14e commit ecf00d6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

scripts/flat-dts.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,11 @@ function consumeTypeAnnotation(source: SourceCode): SourceCode {
586586
let start = source.pos;
587587
source.consume(/:/y, "Expected ':'");
588588
source.consumeSpaces();
589+
590+
if (source.consumeOptional(/(?:asserts\s+)?\w+\s+is\b/y)) {
591+
source.consumeSpaces();
592+
}
593+
589594
while (true) {
590595
// readonly
591596
while (source.consumeOptional(/readonly\b/y)) {

0 commit comments

Comments
 (0)