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

Function addSymbol

test/fixtures/snapshot/typescript.js:153618–153625  ·  view source on GitHub ↗
(moduleSymbol, toFile, exportedSymbol, exportKind, program, isFromPackageJson)

Source from the content-addressed store, hash-verified

153616 return ts.createModuleSpecifierResolutionHost(isFromPackageJson ? host.getPackageJsonAutoImportProvider() : program, host);
153617 });
153618 function addSymbol(moduleSymbol, toFile, exportedSymbol, exportKind, program, isFromPackageJson) {
153619 var moduleSpecifierResolutionHost = getModuleSpecifierResolutionHost(isFromPackageJson);
153620 if (toFile && ts.isImportableFile(program, fromFile, toFile, preferences, packageJsonFilter, moduleSpecifierResolutionHost, moduleSpecifierCache) ||
153621 !toFile && packageJsonFilter.allowsImportingAmbientModule(moduleSymbol, moduleSpecifierResolutionHost)) {
153622 var checker = program.getTypeChecker();
153623 originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { symbol: exportedSymbol, moduleSymbol: moduleSymbol, moduleFileName: toFile === null || toFile === void 0 ? void 0 : toFile.fileName, exportKind: exportKind, targetFlags: ts.skipAlias(exportedSymbol, checker).flags, isFromPackageJson: isFromPackageJson });
153624 }
153625 }
153626 ts.forEachExternalModuleToImportFrom(program, host, useAutoImportProvider, function (moduleSymbol, sourceFile, program, isFromPackageJson) {
153627 var checker = program.getTypeChecker();
153628 cancellationToken.throwIfCancellationRequested();

Callers 1

getExportInfosFunction · 0.85

Calls 2

addMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected