returns {Promise | string | undefined} only works when enabled */ function defaultGetFormatWithoutErrors(url, context) { const parsed = new URL(url); if (!ObjectPrototypeHasOwnProperty(protocolHandlers, parsed.protocol)) return null; return protocolHandlers[parsed.protocol](parsed, context, true); } /** * @param {URL | URL['href']} url * @param {{parentURL: string}} context * @returns {Promise | string | undefined} only works when enabled */ function defaultGetFormat(url, context) { const parsed = new URL(url); return ObjectPrototypeHasOwnProperty(protocolHandlers, parsed.protocol) ? protocolHandlers[parsed.protocol](parsed, context, false) : null; } module.exports = { defaultGetFormat, defaultGetFormatWithoutErrors, extensionFormatMap, };