MCPcopy Index your code
hub / github.com/nodejs/node / getFalsyFlags

Function getFalsyFlags

test/fixtures/snapshot/typescript.js:67594–67601  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

67592 // flags for the string, number, boolean, "", 0, false, void, undefined, or null types respectively. Returns
67593 // no flags for all other types (including non-falsy literal types).
67594 function getFalsyFlags(type) {
67595 return type.flags & 1048576 /* TypeFlags.Union */ ? getFalsyFlagsOfTypes(type.types) :
67596 type.flags & 128 /* TypeFlags.StringLiteral */ ? type.value === "" ? 128 /* TypeFlags.StringLiteral */ : 0 :
67597 type.flags & 256 /* TypeFlags.NumberLiteral */ ? type.value === 0 ? 256 /* TypeFlags.NumberLiteral */ : 0 :
67598 type.flags & 2048 /* TypeFlags.BigIntLiteral */ ? isZeroBigInt(type) ? 2048 /* TypeFlags.BigIntLiteral */ : 0 :
67599 type.flags & 512 /* TypeFlags.BooleanLiteral */ ? (type === falseType || type === regularFalseType) ? 512 /* TypeFlags.BooleanLiteral */ : 0 :
67600 type.flags & 117724 /* TypeFlags.PossiblyFalsy */;
67601 }
67602 function removeDefinitelyFalsyTypes(type) {
67603 return getFalsyFlags(type) & 117632 /* TypeFlags.DefinitelyFalsy */ ?
67604 filterType(type, function (t) { return !(getFalsyFlags(t) & 117632 /* TypeFlags.DefinitelyFalsy */); }) :

Callers 15

compareSignaturesRelatedFunction · 0.85
getFalsyFlagsOfTypesFunction · 0.85
checkIdentifierFunction · 0.85
isNullableTypeFunction · 0.85
helperFunction · 0.85

Calls 2

getFalsyFlagsOfTypesFunction · 0.85
isZeroBigIntFunction · 0.85

Tested by

no test coverage detected