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

Function convertURLToCJSFilename

lib/internal/modules/customization_hooks.js:147–157  ·  view source on GitHub ↗

* @param {string} url * @returns {string}

(url)

Source from the content-addressed store, hash-verified

145 * @returns {string}
146 */
147function convertURLToCJSFilename(url) {
148 if (!url) { return url; }
149 const builtinId = BuiltinModule.normalizeRequirableId(url);
150 if (builtinId) {
151 return builtinId;
152 }
153 if (StringPrototypeStartsWith(url, 'file://')) {
154 return fileURLToPath(url);
155 }
156 return url;
157}
158
159/**
160 * Convert a list of hooks into a function that can be used to do an operation through

Callers 2

resolveForCJSWithHooksFunction · 0.85
getDefaultLoadFunction · 0.85

Calls 2

fileURLToPathFunction · 0.85
normalizeRequirableIdMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…