@@ -41,6 +41,12 @@ function getDataProtocolModuleFormat(parsed) {
4141 return mimeToFormat ( mime ) ;
4242}
4343
44+ /**
45+ * @param {URL } url
46+ * @param {{parentURL: string} } context
47+ * @param {boolean } ignoreErrors
48+ * @returns {string }
49+ */
4450function getFileProtocolModuleFormat ( url , context , ignoreErrors ) {
4551 const ext = extname ( url . pathname ) ;
4652 if ( ext === '.js' ) {
@@ -59,6 +65,11 @@ function getFileProtocolModuleFormat(url, context, ignoreErrors) {
5965 return getLegacyExtensionFormat ( ext ) ?? null ;
6066}
6167
68+ /**
69+ * @param {URL } url
70+ * @param {{parentURL: string} } context
71+ * @returns {Promise<string> | undefined } only works when enabled
72+ */
6273function getHttpProtocolModuleFormat ( url , context ) {
6374 if ( experimentalNetworkImports ) {
6475 return PromisePrototypeThen (
@@ -70,13 +81,23 @@ function getHttpProtocolModuleFormat(url, context) {
7081 }
7182}
7283
84+ /**
85+ * @param {URL | URL['href'] } url
86+ * @param {{parentURL: string} } context
87+ * @returns {Promise<string> | string | undefined } only works when enabled
88+ */
7389function defaultGetFormatWithoutErrors ( url , context ) {
7490 const parsed = new URL ( url ) ;
7591 if ( ! ObjectPrototypeHasOwnProperty ( protocolHandlers , parsed . protocol ) )
7692 return null ;
7793 return protocolHandlers [ parsed . protocol ] ( parsed , context , true ) ;
7894}
7995
96+ /**
97+ * @param {URL | URL['href'] } url
98+ * @param {{parentURL: string} } context
99+ * @returns {Promise<string> | string | undefined } only works when enabled
100+ */
80101function defaultGetFormat ( url , context ) {
81102 const parsed = new URL ( url ) ;
82103 return ObjectPrototypeHasOwnProperty ( protocolHandlers , parsed . protocol ) ?
0 commit comments