mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-13 11:46:08 -05:00
Revert change to getFalsyFlags (#47125)
* Revert change to getFalsyFlags * Add regression test
This commit is contained in:
@@ -20893,7 +20893,7 @@ namespace ts {
|
||||
// flags for the string, number, boolean, "", 0, false, void, undefined, or null types respectively. Returns
|
||||
// no flags for all other types (including non-falsy literal types).
|
||||
function getFalsyFlags(type: Type): TypeFlags {
|
||||
return type.flags & TypeFlags.UnionOrIntersection ? getFalsyFlagsOfTypes((type as UnionType).types) :
|
||||
return type.flags & TypeFlags.Union ? getFalsyFlagsOfTypes((type as UnionType).types) :
|
||||
type.flags & TypeFlags.StringLiteral ? (type as StringLiteralType).value === "" ? TypeFlags.StringLiteral : 0 :
|
||||
type.flags & TypeFlags.NumberLiteral ? (type as NumberLiteralType).value === 0 ? TypeFlags.NumberLiteral : 0 :
|
||||
type.flags & TypeFlags.BigIntLiteral ? isZeroBigInt(type as BigIntLiteralType) ? TypeFlags.BigIntLiteral : 0 :
|
||||
|
||||
Reference in New Issue
Block a user