@@ -183,12 +183,12 @@ of these top-level routines.
183
183
PACKAGE_RESOLVE(_packageSpecifier_, _parentURL_)
184
184
> 1. Let _packageName_ be *undefined*.
185
185
> 1. Let _packagePath_ be *undefined*.
186
+ > 1. If _packageSpecifier_ is an empty string, then
187
+ > 1. Throw an _Invalid Package Name_ error.
186
188
> 1. If _packageSpecifier_ does not start with _"@"_, then
187
- > 1. If _packageSpecifier_ is an empty string, then
188
- > 1. Throw an _Invalid Package Name_ error.
189
189
> 1. Set _packageName_ to the substring of _packageSpecifier_ until the
190
190
> first _"/"_ separator or the end of the string.
191
- > 1. If _packageSpecifier_ starts with _"@"_, then
191
+ > 1. Otherwise,
192
192
> 1. If _packageSpecifier_ does not contain a _"/"_ separator, then
193
193
> 1. Throw an _Invalid Package Name_ error.
194
194
> 1. Set _packageName_ to the substring of _packageSpecifier_
@@ -225,7 +225,7 @@ PACKAGE_MAIN_RESOLVE(_packageURL_)
225
225
path _packageURL_.
226
226
> 1. If the file at _pjsonURL_ exists, then
227
227
> 1. Let _pjson_ be the result of **READ_JSON_FILE**(_pjsonURL_).
228
- > 1. If **HAS_ESM_PROPERTIES**(_pjson_) is *true *, then
228
+ > 1. If **HAS_ESM_PROPERTIES**(_pjson_) is *false *, then
229
229
> 1. Let _mainURL_ be the result applying the legacy
230
230
> **LOAD_AS_DIRECTORY** CommonJS resolver to _packageURL_, returning
231
231
> *undefined* for no resolution.
@@ -250,7 +250,6 @@ PACKAGE_MAIN_RESOLVE(_packageURL_)
250
250
> 1. If _url_ does not end in _".js"_ then,
251
251
> 1. Throw an _Unknown Module Format_ error.
252
252
> 1. Return _"cjs"_.
253
-
254
253
> 1. If **HAS_ESM_PROPERTIES**(_pjson_) is *true*, then
255
254
> 1. Return _"esm"_.
256
255
> 1. Return _"cjs"_.
0 commit comments