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

Function serializeBaseType

test/fixtures/snapshot/typescript.js:55252–55263  ·  view source on GitHub ↗
(t, staticType, rootName)

Source from the content-addressed store, hash-verified

55250 return results;
55251 }
55252 function serializeBaseType(t, staticType, rootName) {
55253 var ref = trySerializeAsTypeReference(t, 111551 /* SymbolFlags.Value */);
55254 if (ref) {
55255 return ref;
55256 }
55257 var tempName = getUnusedName("".concat(rootName, "_base"));
55258 var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([
55259 ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))
55260 ], 2 /* NodeFlags.Const */));
55261 addResult(statement, 0 /* ModifierFlags.None */);
55262 return ts.factory.createExpressionWithTypeArguments(ts.factory.createIdentifier(tempName), /*typeArgs*/ undefined);
55263 }
55264 function trySerializeAsTypeReference(t, flags) {
55265 var typeArgs;
55266 var reference;

Callers 1

serializeAsClassFunction · 0.85

Calls 5

getUnusedNameFunction · 0.85
typeToTypeNodeHelperFunction · 0.85
addResultFunction · 0.85
concatMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…