Skip to content
This repository was archived by the owner on Apr 16, 2020. It is now read-only.

Commit 7f791e9

Browse files
committed
feedback from @SMotaal
1 parent 917a4c3 commit 7f791e9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

doc/api/esm.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ of these top-level routines.
183183
PACKAGE_RESOLVE(_packageSpecifier_, _parentURL_)
184184
> 1. Let _packageName_ be *undefined*.
185185
> 1. Let _packagePath_ be *undefined*.
186+
> 1. If _packageSpecifier_ is an empty string, then
187+
> 1. Throw an _Invalid Package Name_ error.
186188
> 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.
189189
> 1. Set _packageName_ to the substring of _packageSpecifier_ until the
190190
> first _"/"_ separator or the end of the string.
191-
> 1. If _packageSpecifier_ starts with _"@"_, then
191+
> 1. Otherwise,
192192
> 1. If _packageSpecifier_ does not contain a _"/"_ separator, then
193193
> 1. Throw an _Invalid Package Name_ error.
194194
> 1. Set _packageName_ to the substring of _packageSpecifier_
@@ -225,7 +225,7 @@ PACKAGE_MAIN_RESOLVE(_packageURL_)
225225
path _packageURL_.
226226
> 1. If the file at _pjsonURL_ exists, then
227227
> 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
229229
> 1. Let _mainURL_ be the result applying the legacy
230230
> **LOAD_AS_DIRECTORY** CommonJS resolver to _packageURL_, returning
231231
> *undefined* for no resolution.
@@ -250,7 +250,6 @@ PACKAGE_MAIN_RESOLVE(_packageURL_)
250250
> 1. If _url_ does not end in _".js"_ then,
251251
> 1. Throw an _Unknown Module Format_ error.
252252
> 1. Return _"cjs"_.
253-
254253
> 1. If **HAS_ESM_PROPERTIES**(_pjson_) is *true*, then
255254
> 1. Return _"esm"_.
256255
> 1. Return _"cjs"_.

0 commit comments

Comments
 (0)