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

Function isLiteralConstDeclaration

test/fixtures/snapshot/typescript.js:87204–87209  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

87202 return undefined;
87203 }
87204 function isLiteralConstDeclaration(node) {
87205 if (ts.isDeclarationReadonly(node) || ts.isVariableDeclaration(node) && ts.isVarConst(node)) {
87206 return isFreshLiteralType(getTypeOfSymbol(getSymbolOfNode(node)));
87207 }
87208 return false;
87209 }
87210 function literalTypeToNode(type, enclosing, tracker) {
87211 var enumResult = type.flags & 1024 /* TypeFlags.EnumLiteral */ ? nodeBuilder.symbolToExpression(type.symbol, 111551 /* SymbolFlags.Value */, enclosing, /*flags*/ undefined, tracker)
87212 : type === trueType ? ts.factory.createTrue() : type === falseType && ts.factory.createFalse();

Callers

nothing calls this directly

Calls 3

isFreshLiteralTypeFunction · 0.85
getTypeOfSymbolFunction · 0.85
getSymbolOfNodeFunction · 0.85

Tested by

no test coverage detected