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

Function getSubstitutionType

test/fixtures/snapshot/typescript.js:60454–60468  ·  view source on GitHub ↗
(baseType, substitute)

Source from the content-addressed store, hash-verified

60452 return links.resolvedJSDocType;
60453 }
60454 function getSubstitutionType(baseType, substitute) {
60455 if (substitute.flags & 3 /* TypeFlags.AnyOrUnknown */ || substitute === baseType) {
60456 return baseType;
60457 }
60458 var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(substitute));
60459 var cached = substitutionTypes.get(id);
60460 if (cached) {
60461 return cached;
60462 }
60463 var result = createType(33554432 /* TypeFlags.Substitution */);
60464 result.baseType = baseType;
60465 result.substitute = substitute;
60466 substitutionTypes.set(id, result);
60467 return result;
60468 }
60469 function isUnaryTupleTypeNode(node) {
60470 return node.kind === 184 /* SyntaxKind.TupleType */ && node.elements.length === 1;
60471 }

Callers 2

instantiateTypeWorkerFunction · 0.85

Calls 5

getTypeIdFunction · 0.85
createTypeFunction · 0.85
concatMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…