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

Function convertToTSConfig

test/fixtures/snapshot/typescript.js:41155–41166  ·  view source on GitHub ↗

@internal

(configParseResult, configFileName, host)

Source from the content-addressed store, hash-verified

41153 */
41154 /** @internal */
41155 function convertToTSConfig(configParseResult, configFileName, host) {
41156 var _a, _b, _c;
41157 var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames);
41158 var files = ts.map(ts.filter(configParseResult.fileNames, !((_b = (_a = configParseResult.options.configFile) === null || _a === void 0 ? void 0 : _a.configFileSpecs) === null || _b === void 0 ? void 0 : _b.validatedIncludeSpecs) ? ts.returnTrue : matchesSpecs(configFileName, configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs, configParseResult.options.configFile.configFileSpecs.validatedExcludeSpecs, host)), function (f) { return ts.getRelativePathFromFile(ts.getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), ts.getNormalizedAbsolutePath(f, host.getCurrentDirectory()), getCanonicalFileName); });
41159 var optionMap = serializeCompilerOptions(configParseResult.options, { configFilePath: ts.getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames });
41160 var watchOptionMap = configParseResult.watchOptions && serializeWatchOptions(configParseResult.watchOptions);
41161 var config = __assign(__assign({ compilerOptions: __assign(__assign({}, optionMapToObject(optionMap)), { showConfig: undefined, configFile: undefined, configFilePath: undefined, help: undefined, init: undefined, listFiles: undefined, listEmittedFiles: undefined, project: undefined, build: undefined, version: undefined }), watchOptions: watchOptionMap && optionMapToObject(watchOptionMap), references: ts.map(configParseResult.projectReferences, function (r) { return (__assign(__assign({}, r), { path: r.originalPath ? r.originalPath : "", originalPath: undefined })); }), files: ts.length(files) ? files : undefined }, (((_c = configParseResult.options.configFile) === null || _c === void 0 ? void 0 : _c.configFileSpecs) ? {
41162 include: filterSameAsDefaultInclude(configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs),
41163 exclude: configParseResult.options.configFile.configFileSpecs.validatedExcludeSpecs
41164 } : {})), { compileOnSave: !!configParseResult.compileOnSave ? true : undefined });
41165 return config;
41166 }
41167 ts.convertToTSConfig = convertToTSConfig;
41168 function optionMapToObject(optionMap) {
41169 return __assign({}, ts.arrayFrom(optionMap.entries()).reduce(function (prev, cur) {

Callers

nothing calls this directly

Calls 8

matchesSpecsFunction · 0.85
serializeCompilerOptionsFunction · 0.85
serializeWatchOptionsFunction · 0.85
optionMapToObjectFunction · 0.85
mapMethod · 0.65
filterMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…