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

Function getExtendsConfigPath

test/fixtures/snapshot/typescript.js:41777–41797  ·  view source on GitHub ↗
(extendedConfig, host, basePath, errors, createDiagnostic)

Source from the content-addressed store, hash-verified

41775 return { raw: json, options: options, watchOptions: watchOptions, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath };
41776 }
41777 function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) {
41778 extendedConfig = ts.normalizeSlashes(extendedConfig);
41779 if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
41780 var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
41781 if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Extension.Json */)) {
41782 extendedConfigPath = "".concat(extendedConfigPath, ".json");
41783 if (!host.fileExists(extendedConfigPath)) {
41784 errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
41785 return undefined;
41786 }
41787 }
41788 return extendedConfigPath;
41789 }
41790 // If the path isn't a rooted or relative path, resolve like a module
41791 var resolved = ts.nodeModuleNameResolver(extendedConfig, ts.combinePaths(basePath, "tsconfig.json"), { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, /*cache*/ undefined, /*projectRefs*/ undefined, /*lookupConfig*/ true);
41792 if (resolved.resolvedModule) {
41793 return resolved.resolvedModule.resolvedFileName;
41794 }
41795 errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
41796 return undefined;
41797 }
41798 function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache) {
41799 var _a;
41800 var path = host.useCaseSensitiveFileNames ? extendedConfigPath : ts.toFileNameLowerCase(extendedConfigPath);

Callers 2

parseOwnConfigOfJsonFunction · 0.85

Calls 3

createDiagnosticFunction · 0.85
concatMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected