* See resolveForCJSWithHooks. * @param {string} specifier * @param {Module|undefined} parent * @param {boolean} isMain * @param {ResolveFilenameOptions} options * @returns {{url?: string, format?: string, parentURL?: string, filename: string}}
(specifier, parent, isMain, options)
| 1132 | * @returns {{url?: string, format?: string, parentURL?: string, filename: string}} |
| 1133 | */ |
| 1134 | function defaultResolveImplForCJSLoading(specifier, parent, isMain, options) { |
| 1135 | // For backwards compatibility, when encountering requests starting with node:, |
| 1136 | // throw ERR_UNKNOWN_BUILTIN_MODULE on failure or return the normalized ID on success |
| 1137 | // without going into Module._resolveFilename. |
| 1138 | let normalized; |
| 1139 | if (StringPrototypeStartsWith(specifier, 'node:')) { |
| 1140 | normalized = BuiltinModule.normalizeRequirableId(specifier); |
| 1141 | if (!normalized) { |
| 1142 | throw new ERR_UNKNOWN_BUILTIN_MODULE(specifier); |
| 1143 | } |
| 1144 | return { __proto__: null, url: specifier, format: 'builtin', filename: normalized }; |
| 1145 | } |
| 1146 | return wrapResolveFilename(specifier, parent, isMain, options); |
| 1147 | } |
| 1148 | |
| 1149 | /** |
| 1150 | * @typedef {{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…