Skip to content

Commit

Permalink
doc: fix some recent doc nits
Browse files Browse the repository at this point in the history
* Fix formatting.
* Fix list numbering.
* Unify abbreviation casing.
* Use an uppercased constructor in a hypothetic code example.
* Fix typos.
* Fix sorting in sections and references.

PR-URL: #30341
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
vsemozhetbyt authored and trivikr committed Nov 13, 2019
1 parent 796f3d0 commit 3d92689
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ The default is `explicit`, which requires providing the full path to a
module. The `node` mode will enable support for optional file extensions and
the ability to import a directory that has an index file.

Please see [customizing esm specifier resolution][] for example usage.
Please see [customizing ESM specifier resolution][] for example usage.

### `--experimental-conditional-exports
### `--experimental-conditional-exports`
<!-- YAML
added: REPLACEME
-->
Expand Down Expand Up @@ -1321,17 +1321,17 @@ greater than `4` (its current default value). For more information, see the
[`tls.DEFAULT_MIN_VERSION`]: tls.html#tls_tls_default_min_version
[`unhandledRejection`]: process.html#process_event_unhandledrejection
[Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/
[Conditional Exports]: esm.html#esm_conditional_exports
[REPL]: repl.html
[ScriptCoverage]: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage
[Source Map]: https://sourcemaps.info/spec.html
[Subresource Integrity]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
[customizing esm specifier resolution]: esm.html#esm_customizing_esm_specifier_resolution_algorithm
[context-aware]: addons.html#addons_context_aware_addons
[customizing ESM specifier resolution]: esm.html#esm_customizing_esm_specifier_resolution_algorithm
[debugger]: debugger.html
[debugging security implications]: https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implications
[emit_warning]: process.html#process_process_emitwarning_warning_type_code_ctor
[experimental ECMAScript Module loader]: esm.html#esm_resolve_hook
[libuv threadpool documentation]: http://docs.libuv.org/en/latest/threadpool.html
[remote code execution]: https://www.owasp.org/index.php/Code_Injection
[context-aware]: addons.html#addons_context_aware_addons
[Conditional Exports]: esm.html#esm_conditional_exports
8 changes: 4 additions & 4 deletions doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,9 @@ CommonJS and ES module instances of the package:
package, it would be used like this:

```js
import date from 'date';
const someDate = new date();
// someDate contains state; date does not
import Date from 'date';
const someDate = new Date();
// someDate contains state; Date does not
```

The `new` keyword isn’t required; a package’s function can return a new
Expand Down Expand Up @@ -1217,7 +1217,7 @@ _defaultEnv_ is the conditional environment name priority array,
> 1. Throw a _Module Not Found_ error.
> 1. If _pjson.exports_ is not **null** or **undefined**, then
> 1. If _exports_ is an Object with both a key starting with _"."_ and a key
> not starting with _"."_, throw a "Invalid Package Configuration" error.
> not starting with _"."_, throw an "Invalid Package Configuration" error.
> 1. If _pjson.exports_ is a String or Array, or an Object containing no
> keys starting with _"."_, then
> 1. Return **PACKAGE_EXPORTS_TARGET_RESOLVE**(_packageURL_,
Expand Down
14 changes: 7 additions & 7 deletions doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,15 @@ RESOLVE_BARE_SPECIFIER(DIR, X)
b. If "exports" is null or undefined, GOTO 3.
c. If "exports" is an object with some keys starting with "." and some keys
not starting with ".", throw "invalid config".
c. If "exports" is a string, or object with no keys starting with ".", treat
d. If "exports" is a string, or object with no keys starting with ".", treat
it as having that value as its "." object property.
d. If subpath is "." and "exports" does not have a "." entry, GOTO 3.
e. Find the longest key in "exports" that the subpath starts with.
f. If no such key can be found, throw "not found".
g. let RESOLVED_URL =
e. If subpath is "." and "exports" does not have a "." entry, GOTO 3.
f. Find the longest key in "exports" that the subpath starts with.
g. If no such key can be found, throw "not found".
h. let RESOLVED_URL =
PACKAGE_EXPORTS_TARGET_RESOLVE(pathToFileURL(DIR/name), exports[key],
subpath.slice(key.length)), as defined in the esm resolver.
h. return fileURLToPath(RESOLVED_URL)
subpath.slice(key.length)), as defined in the ESM resolver.
i. return fileURLToPath(RESOLVED_URL)
3. return DIR/X
```

Expand Down
6 changes: 3 additions & 3 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ Enable experimental JSON interop support for the ES Module loader.
.It Fl -experimental-modules
Enable experimental latest experimental modules features.
.
.It Fl -experimental-resolve-self
Enable experimental support for a package to load itself.
.
.It Fl -experimental-policy
Use the specified file as a security policy.
.
Expand All @@ -138,6 +135,9 @@ Enable experimental
.Sy diagnostic report
feature.
.
.It Fl -experimental-resolve-self
Enable experimental support for a package to load itself.
.
.It Fl -experimental-vm-modules
Enable experimental ES module support in VM module.
.
Expand Down

0 comments on commit 3d92689

Please sign in to comment.