protocol !== 'file:' && protocol !== 'data:' && protocol !== 'node:' && ( !experimentalNetworkImports || ( protocol !== 'https:' && protocol !== 'http:' ) ) ) { const schemes = ['file', 'data', 'node']; if (experimentalNetworkImports) { ArrayPrototypePush(schemes, 'https', 'http'); } throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed, schemes); } } /** * For a falsy `format` returned from `load`, throw an error. * This could happen from either a custom user loader _or_ from the default loader, because the default loader tries to * determine formats for data URLs. * @param {string} url The resolved URL of the module * @param {null | undefined | false | 0 | -0 | 0n | ''} format Falsy format returned from `load` */ function throwUnknownModuleFormat(url, format) { const dataUrl = RegExpPrototypeExec( /^data:([^/]+\/[^;,]+)(?:[^,]*?)(;base64)?,/, url, ); throw new ERR_UNKNOWN_MODULE_FORMAT( dataUrl ? dataUrl[1] : format, url); } module.exports = { defaultLoad, throwUnknownModuleFormat, };