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

Function errPath

lib/internal/modules/esm/translators.js:71–77  ·  view source on GitHub ↗

* Converts a URL to a file path if the URL protocol is 'file:'. * @param {string} url - The URL to convert. * @returns {string|URL}

(url)

Source from the content-addressed store, hash-verified

69 * @returns {string|URL}
70 */
71function errPath(url) {
72 const parsed = new URL(url);
73 if (parsed.protocol === 'file:') {
74 return fileURLToPath(parsed);
75 }
76 return url;
77}
78
79// Strategy for loading a standard JavaScript module.
80translators.set('module', function moduleStrategy(url, translateContext, parentURL) {

Callers 1

translators.jsFile · 0.85

Calls 1

fileURLToPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…