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

Function typeToTypeNodeOrCircularityElision

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

Source from the content-addressed store, hash-verified

52664 return ts.factory.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);
52665 }
52666 function typeToTypeNodeOrCircularityElision(type) {
52667 var _a, _b, _c;
52668 if (type.flags & 1048576 /* TypeFlags.Union */) {
52669 if ((_a = context.visitedTypes) === null || _a === void 0 ? void 0 : _a.has(getTypeId(type))) {
52670 if (!(context.flags & 131072 /* NodeBuilderFlags.AllowAnonymousIdentifier */)) {
52671 context.encounteredError = true;
52672 (_c = (_b = context.tracker) === null || _b === void 0 ? void 0 : _b.reportCyclicStructureError) === null || _c === void 0 ? void 0 : _c.call(_b);
52673 }
52674 return createElidedInformationPlaceholder(context);
52675 }
52676 return visitAndTransformType(type, function (type) { return typeToTypeNodeHelper(type, context); });
52677 }
52678 return typeToTypeNodeHelper(type, context);
52679 }
52680 function createMappedTypeNodeFromType(type) {
52681 ts.Debug.assert(!!(type.flags & 524288 /* TypeFlags.Object */));
52682 var readonlyToken = type.declaration.readonlyToken ? ts.factory.createToken(type.declaration.readonlyToken.kind) : undefined;

Callers 1

Calls 6

getTypeIdFunction · 0.85
visitAndTransformTypeFunction · 0.85
typeToTypeNodeHelperFunction · 0.85
hasMethod · 0.65
callMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…