Fix services' type's isLiteral implementation (#50929)

* fix services' type's isLiteral

* update literal completions tests

* remove booleans from literals
This commit is contained in:
Gabriela Araujo Britto
2022-11-02 15:28:10 -03:00
committed by GitHub
parent c1e9afd542
commit fdcb2ffd1b
2 changed files with 11 additions and 1 deletions

View File

@@ -511,7 +511,7 @@ namespace ts {
return !!(this.flags & TypeFlags.UnionOrIntersection);
}
isLiteral(): this is LiteralType {
return !!(this.flags & TypeFlags.StringOrNumberLiteral);
return !!(this.flags & (TypeFlags.StringLiteral | TypeFlags.NumberLiteral | TypeFlags.BigIntLiteral));
}
isStringLiteral(): this is StringLiteralType {
return !!(this.flags & TypeFlags.StringLiteral);