MCPcopy Create free account
hub / github.com/nodejs/node / getBaseTypeOfLiteralType

Function getBaseTypeOfLiteralType

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

Source from the content-addressed store, hash-verified

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 :
67497 type.flags & 256 /* TypeFlags.NumberLiteral */ ? numberType :
67498 type.flags & 2048 /* TypeFlags.BigIntLiteral */ ? bigintType :
67499 type.flags & 512 /* TypeFlags.BooleanLiteral */ ? booleanType :
67500 type.flags & 1048576 /* TypeFlags.Union */ ? mapType(type, getBaseTypeOfLiteralType) :
67501 type;
67502 }
67503 function getWidenedLiteralType(type) {
67504 return type.flags & 1024 /* TypeFlags.EnumLiteral */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLiteralType(type) :
67505 type.flags & 128 /* TypeFlags.StringLiteral */ && isFreshLiteralType(type) ? stringType :

Callers 11

reportRelationErrorFunction · 0.85
getTypeAtFlowAssignmentFunction · 0.85
checkIdentifierFunction · 0.85
checkAssertionWorkerFunction · 0.85
getBaseTypesIfUnrelatedFunction · 0.85

Calls 2

mapTypeFunction · 0.85

Tested by

no test coverage detected