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

Function tryLoadModuleUsingPathsIfEligible

test/fixtures/snapshot/typescript.js:43180–43194  ·  view source on GitHub ↗
(extensions, moduleName, loader, state)

Source from the content-addressed store, hash-verified

43178 }
43179 }
43180 function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) {
43181 var _a;
43182 var _b = state.compilerOptions, baseUrl = _b.baseUrl, paths = _b.paths, configFile = _b.configFile;
43183 if (paths && !ts.pathIsRelative(moduleName)) {
43184 if (state.traceEnabled) {
43185 if (baseUrl) {
43186 trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName);
43187 }
43188 trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName);
43189 }
43190 var baseDirectory = ts.getPathsBasePath(state.compilerOptions, state.host); // Always defined when 'paths' is defined
43191 var pathPatterns = (configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) ? (_a = configFile.configFileSpecs).pathPatterns || (_a.pathPatterns = ts.tryParsePatterns(paths)) : undefined;
43192 return tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, pathPatterns, loader, /*onlyRecordFailures*/ false, state);
43193 }
43194 }
43195 function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state) {
43196 if (!state.compilerOptions.rootDirs) {
43197 return undefined;

Calls 2

traceFunction · 0.85
tryLoadModuleUsingPathsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…