(specifier, parentURL)
| 709 | } |
| 710 | |
| 711 | ESM_RESOLVE(specifier, parentURL) { |
| 712 | let resolved = this.validateURL(specifier); |
| 713 | if (!resolved) { |
| 714 | if (specifier.startsWith('/') || specifier.startsWith('./') || specifier.startsWith('../')) |
| 715 | resolved = this.mergeURL(specifier, parentURL); |
| 716 | else if (specifier.startsWith('#')) |
| 717 | resolved = this.PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, defaultConditions); |
| 718 | else |
| 719 | resolved = this.PACKAGE_RESOLVE(specifier, parentURL); |
| 720 | } |
| 721 | if (resolved.startsWith("file://")) { |
| 722 | if ((resolved.indexOf("%2F") >= 0) || (resolved.indexOf("%5C") >= 0)) |
| 723 | this.throwInvalidModuleSpecifierError(); |
| 724 | let path = this.urlToFilePath(resolved); |
| 725 | if (!path) |
| 726 | this.throwModuleNotFoundError(); |
| 727 | let format = this.ESM_FILE_FORMAT(resolved); |
| 728 | if ((format !== "module") && (format !== "json")) |
| 729 | this.throwUnsupportedModuleFormat(format); |
| 730 | } |
| 731 | return resolved; |
| 732 | } |
| 733 | PACKAGE_RESOLVE(packageSpecifier, parentURL) { |
| 734 | let packageName; |
| 735 | if (packageSpecifier === "") |
no test coverage detected