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

Function normalizePathForCJSResolution

test/fixtures/snapshot/typescript.js:43418–43424  ·  view source on GitHub ↗
(containingDirectory, moduleName)

Source from the content-addressed store, hash-verified

43416 // (https://nodejs.org/api/modules.html#all-together), but it seems that module paths ending
43417 // in `.` are actually normalized to `./` before proceeding with the resolution algorithm.
43418 function normalizePathForCJSResolution(containingDirectory, moduleName) {
43419 var combined = ts.combinePaths(containingDirectory, moduleName);
43420 var parts = ts.getPathComponents(combined);
43421 var lastPart = ts.lastOrUndefined(parts);
43422 var path = lastPart === "." || lastPart === ".." ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(combined)) : ts.normalizePath(combined);
43423 return { path: path, parts: parts };
43424 }
43425 function realPath(path, host, traceEnabled) {
43426 if (!host.realpath) {
43427 return path;

Callers 2

secondaryLookupFunction · 0.85
tryResolveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…