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

Function getModuleResolutionHost

test/fixtures/snapshot/typescript.js:121973–121983  ·  view source on GitHub ↗
(host)

Source from the content-addressed store, hash-verified

121971 return ts.getImpliedNodeFormatForFile(importingSourceFileName, (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host), getModuleResolutionHost(host), compilerOptions) !== ts.ModuleKind.CommonJS;
121972 }
121973 function getModuleResolutionHost(host) {
121974 var _a;
121975 return {
121976 fileExists: host.fileExists,
121977 readFile: ts.Debug.checkDefined(host.readFile),
121978 directoryExists: host.directoryExists,
121979 getCurrentDirectory: host.getCurrentDirectory,
121980 realpath: host.realpath,
121981 useCaseSensitiveFileNames: (_a = host.useCaseSensitiveFileNames) === null || _a === void 0 ? void 0 : _a.call(host),
121982 };
121983 }
121984 // `importingSourceFile` and `importingSourceFileName`? Why not just use `importingSourceFile.path`?
121985 // Because when this is called by the file renamer, `importingSourceFile` is the file being renamed,
121986 // while `importingSourceFileName` its *new* name. We need a source file just to get its

Callers 1

Calls 1

callMethod · 0.45

Tested by

no test coverage detected