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

Function isLiteralType

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

Source from the content-addressed store, hash-verified

67487 return type.flags & 2097152 /* TypeFlags.Intersection */ ? ts.find(type.types, isUnitType) || type : type;
67488 }
67489 function isLiteralType(type) {
67490 return type.flags & 16 /* TypeFlags.Boolean */ ? true :
67491 type.flags & 1048576 /* TypeFlags.Union */ ? type.flags & 1024 /* TypeFlags.EnumLiteral */ ? true : ts.every(type.types, isUnitType) :
67492 isUnitType(type);
67493 }
67494 function getBaseTypeOfLiteralType(type) {
67495 return type.flags & 1024 /* TypeFlags.EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
67496 type.flags & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ? stringType :

Callers 8

reportRelationErrorFunction · 0.85
inferFromTypesFunction · 0.85
_loop_23Function · 0.85
checkSwitchStatementFunction · 0.85

Calls 2

isUnitTypeFunction · 0.85
everyMethod · 0.80

Tested by

no test coverage detected