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

Function createNodeBuilder

test/fixtures/snapshot/typescript.js:52300–55340  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52298 return !!type.symbol && !!(type.symbol.flags & 32 /* SymbolFlags.Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288 /* TypeFlags.Object */) && !!(ts.getObjectFlags(type) & 16777216 /* ObjectFlags.IsClassInstanceClone */)));
52299 }
52300 function createNodeBuilder() {
52301 return {
52302 typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) {
52303 return withContext(enclosingDeclaration, flags, tracker, function (context) { return typeToTypeNodeHelper(type, context); });
52304 },
52305 indexInfoToIndexSignatureDeclaration: function (indexInfo, enclosingDeclaration, flags, tracker) {
52306 return withContext(enclosingDeclaration, flags, tracker, function (context) { return indexInfoToIndexSignatureDeclarationHelper(indexInfo, context, /*typeNode*/ undefined); });
52307 },
52308 signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags, tracker) {
52309 return withContext(enclosingDeclaration, flags, tracker, function (context) { return signatureToSignatureDeclarationHelper(signature, kind, context); });
52310 },
52311 symbolToEntityName: function (symbol, meaning, enclosingDeclaration, flags, tracker) {
52312 return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToName(symbol, context, meaning, /*expectsIdentifier*/ false); });
52313 },
52314 symbolToExpression: function (symbol, meaning, enclosingDeclaration, flags, tracker) {
52315 return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToExpression(symbol, context, meaning); });
52316 },
52317 symbolToTypeParameterDeclarations: function (symbol, enclosingDeclaration, flags, tracker) {
52318 return withContext(enclosingDeclaration, flags, tracker, function (context) { return typeParametersToTypeParameterDeclarations(symbol, context); });
52319 },
52320 symbolToParameterDeclaration: function (symbol, enclosingDeclaration, flags, tracker) {
52321 return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToParameterDeclaration(symbol, context); });
52322 },
52323 typeParameterToDeclaration: function (parameter, enclosingDeclaration, flags, tracker) {
52324 return withContext(enclosingDeclaration, flags, tracker, function (context) { return typeParameterToDeclaration(parameter, context); });
52325 },
52326 symbolTableToDeclarationStatements: function (symbolTable, enclosingDeclaration, flags, tracker, bundled) {
52327 return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolTableToDeclarationStatements(symbolTable, context, bundled); });
52328 },
52329 };
52330 function withContext(enclosingDeclaration, flags, tracker, cb) {
52331 var _a, _b;
52332 ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* NodeFlags.Synthesized */) === 0);
52333 var context = {
52334 enclosingDeclaration: enclosingDeclaration,
52335 flags: flags || 0 /* NodeBuilderFlags.None */,
52336 // If no full tracker is provided, fake up a dummy one with a basic limited-functionality moduleResolverHost
52337 tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: function () { return false; }, moduleResolverHost: flags & 134217728 /* NodeBuilderFlags.DoNotIncludeSymbolChain */ ? {
52338 getCommonSourceDirectory: !!host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; },
52339 getCurrentDirectory: function () { return host.getCurrentDirectory(); },
52340 getSymlinkCache: ts.maybeBind(host, host.getSymlinkCache),
52341 getPackageJsonInfoCache: function () { var _a; return (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host); },
52342 useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames),
52343 redirectTargetsMap: host.redirectTargetsMap,
52344 getProjectReferenceRedirect: function (fileName) { return host.getProjectReferenceRedirect(fileName); },
52345 isSourceOfProjectReferenceRedirect: function (fileName) { return host.isSourceOfProjectReferenceRedirect(fileName); },
52346 fileExists: function (fileName) { return host.fileExists(fileName); },
52347 getFileIncludeReasons: function () { return host.getFileIncludeReasons(); },
52348 readFile: host.readFile ? (function (fileName) { return host.readFile(fileName); }) : undefined,
52349 } : undefined },
52350 encounteredError: false,
52351 reportedDiagnostic: false,
52352 visitedTypes: undefined,
52353 symbolDepth: undefined,
52354 inferTypeParameters: undefined,
52355 approximateLength: 0
52356 };
52357 context.tracker = wrapSymbolTrackerToReportForContext(context, context.tracker);

Callers 1

createTypeCheckerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…