Skip to content

Commit 2e80968

Browse files
committed
doc: updates for better json generating
1 parent 64c6d97 commit 2e80968

16 files changed

+56
-59
lines changed

doc/api/assert.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ added:
296296

297297
* `fn` {Function} **Default:** A no-op function.
298298
* `exact` {number} **Default:** `1`.
299-
* Returns: {Function} that wraps `fn`.
299+
* Returns: {Function} A function that wraps `fn`.
300300

301301
The wrapper function is expected to be called exactly `exact` times. If the
302302
function has not been called exactly `exact` times when
@@ -337,9 +337,9 @@ added:
337337
- v16.18.0
338338
-->
339339

340-
* `fn` {Function}.
340+
* `fn` {Function}
341341

342-
* Returns: {Array} with all the calls to a tracked function.
342+
* Returns: {Array} An array with all the calls to a tracked function.
343343

344344
* Object {Object}
345345
* `thisArg` {Object}
@@ -380,8 +380,8 @@ added:
380380
- v12.19.0
381381
-->
382382

383-
* Returns: {Array} of objects containing information about the wrapper functions
384-
returned by [`tracker.calls()`][].
383+
* Returns: {Array} An array of objects containing information about the wrapper
384+
functions returned by [`tracker.calls()`][].
385385
* Object {Object}
386386
* `message` {string}
387387
* `actual` {number} The actual number of times the function was called.
@@ -457,7 +457,7 @@ added:
457457

458458
Reset calls of the call tracker.
459459
If a tracked function is passed as an argument, the calls will be reset for it.
460-
If no arguments are passed, all tracked functions will be reset
460+
If no arguments are passed, all tracked functions will be reset.
461461

462462
```mjs
463463
import assert from 'node:assert';

doc/api/crypto.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ added: v1.0.0
570570
* `options` {Object} [`stream.transform` options][]
571571
* `plaintextLength` {number}
572572
* `encoding` {string} The string encoding to use when `buffer` is a string.
573-
* Returns: {Cipher} for method chaining.
573+
* Returns: {Cipher} The same `Cipher` instance for method chaining.
574574

575575
When using an authenticated encryption mode (`GCM`, `CCM`, `OCB`, and
576576
`chacha20-poly1305` are
@@ -590,7 +590,7 @@ added: v0.7.1
590590
-->
591591

592592
* `autoPadding` {boolean} **Default:** `true`
593-
* Returns: {Cipher} for method chaining.
593+
* Returns: {Cipher} The same `Cipher` instance for method chaining.
594594

595595
When using block encryption algorithms, the `Cipher` class will automatically
596596
add padding to the input data to the appropriate block size. To disable the
@@ -870,7 +870,7 @@ changes:
870870
* `options` {Object} [`stream.transform` options][]
871871
* `plaintextLength` {number}
872872
* `encoding` {string} String encoding to use when `buffer` is a string.
873-
* Returns: {Decipher} for method chaining.
873+
* Returns: {Decipher} The same Decipher for method chaining.
874874

875875
When using an authenticated encryption mode (`GCM`, `CCM`, `OCB`, and
876876
`chacha20-poly1305` are
@@ -905,7 +905,7 @@ changes:
905905

906906
* `buffer` {string|Buffer|ArrayBuffer|TypedArray|DataView}
907907
* `encoding` {string} String encoding to use when `buffer` is a string.
908-
* Returns: {Decipher} for method chaining.
908+
* Returns: {Decipher} The same Decipher for method chaining.
909909

910910
When using an authenticated encryption mode (`GCM`, `CCM`, `OCB`, and
911911
`chacha20-poly1305` are
@@ -931,7 +931,7 @@ added: v0.7.1
931931
-->
932932

933933
* `autoPadding` {boolean} **Default:** `true`
934-
* Returns: {Decipher} for method chaining.
934+
* Returns: {Decipher} The same Decipher for method chaining.
935935

936936
When data has been encrypted without standard block padding, calling
937937
`decipher.setAutoPadding(false)` will disable automatic padding to prevent

doc/api/events.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1815,7 +1815,7 @@ added:
18151815
18161816
* `signal` {AbortSignal}
18171817
* `listener` {Function|EventListener}
1818-
* Returns: {Disposable} that removes the `abort` listener.
1818+
* Returns: {Disposable} A Disposable that removes the `abort` listener.
18191819

18201820
Listens once to the `abort` event on the provided `signal`.
18211821

doc/api/fs.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3484,7 +3484,7 @@ added: v19.8.0
34843484
* `path` {string|Buffer|URL}
34853485
* `options` {Object}
34863486
* `type` {string} An optional mime type for the blob.
3487-
* Return: {Promise} containing {Blob}
3487+
* Returns: {Promise} Fulfills with a {Blob} upon success.
34883488
34893489
Returns a {Blob} whose data is backed by the given file.
34903490
@@ -6470,7 +6470,7 @@ The read-only path of this directory as was provided to [`fs.opendir()`][],
64706470
added: v12.12.0
64716471
-->
64726472
6473-
* Returns: {Promise} containing {fs.Dirent|null}
6473+
* Returns: {Promise} Fulfills with a {fs.Dirent|null}
64746474
64756475
Asynchronously read the next directory entry via readdir(3) as an
64766476
{fs.Dirent}.
@@ -6528,7 +6528,7 @@ included in the iteration results.
65286528
added: v12.12.0
65296529
-->
65306530
6531-
* Returns: {AsyncIterator} of {fs.Dirent}
6531+
* Returns: {AsyncIterator} An AsyncIterator of {fs.Dirent}
65326532
65336533
Asynchronously iterates over the directory until all entries have
65346534
been read. Refer to the POSIX readdir(3) documentation for more detail.

doc/api/http.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3090,7 +3090,7 @@ added: v0.4.0
30903090
-->
30913091

30923092
* `name` {string} Name of header
3093-
* Returns {string | undefined}
3093+
* Returns: {string | undefined}
30943094

30953095
Gets the value of the HTTP header with the given name. If that header is not
30963096
set, the returned value will be `undefined`.
@@ -3101,7 +3101,7 @@ set, the returned value will be `undefined`.
31013101
added: v7.7.0
31023102
-->
31033103

3104-
* Returns {string\[]}
3104+
* Returns: {string\[]}
31053105

31063106
Returns an array containing the unique names of the current outgoing headers.
31073107
All names are lowercase.
@@ -3140,7 +3140,7 @@ added: v7.7.0
31403140
-->
31413141

31423142
* `name` {string}
3143-
* Returns {boolean}
3143+
* Returns: {boolean}
31443144

31453145
Returns `true` if the header identified by `name` is currently set in the
31463146
outgoing headers. The header name is case-insensitive.
@@ -3360,7 +3360,7 @@ changes:
33603360
* `chunk` {string|Buffer|Uint8Array}
33613361
* `encoding` {string} **Default**: `utf8`
33623362
* `callback` {Function}
3363-
* Returns {boolean}
3363+
* Returns: {boolean}
33643364

33653365
Sends a chunk of the body. This method can be called multiple times.
33663366

doc/api/inspector.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ changes:
444444
**Default:** what was specified on the CLI.
445445
* `wait` {boolean} Block until a client has connected. Optional.
446446
**Default:** `false`.
447-
* Returns: {Disposable} that calls [`inspector.close()`][].
447+
* Returns: {Disposable} A Disposable that calls [`inspector.close()`][].
448448

449449
Activate inspector on host and port. Equivalent to
450450
`node --inspect=[[host:]port]`, but can be done programmatically after node has

doc/api/module.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1020,16 +1020,16 @@ columnNumber)`
10201020
10211021
* `lineNumber` {number} The 1-indexed line number of the call
10221022
site in the generated source
1023-
* `columnOffset` {number} The 1-indexed column number
1023+
* `columnNumber` {number} The 1-indexed column number
10241024
of the call site in the generated source
10251025
* Returns: {Object}
10261026
1027-
Given a 1-indexed lineNumber and columnNumber from a call site in
1027+
Given a 1-indexed `lineNumber` and `columnNumber` from a call site in
10281028
the generated source, find the corresponding call site location
10291029
in the original source.
10301030
1031-
If the lineNumber and columnNumber provided are not found in any
1032-
source map, then an empty object is returned. Otherwise, the
1031+
If the `lineNumber` and `columnNumber` provided are not found in any
1032+
source map, then an empty object is returned. Otherwise, the
10331033
returned object contains the following keys:
10341034
10351035
* name: {string | undefined} The name of the range in the

doc/api/os.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ added:
250250
- v16.18.0
251251
-->
252252

253-
* Returns {string}
253+
* Returns: {string}
254254

255255
Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,
256256
`mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`.
@@ -483,7 +483,7 @@ added:
483483
- v12.17.0
484484
-->
485485

486-
* Returns {string}
486+
* Returns: {string}
487487

488488
Returns a string identifying the kernel version.
489489

doc/api/perf_hooks.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ added:
107107
`eventLoopUtilization()`.
108108
* `utilization2` {Object} The result of a previous call to
109109
`eventLoopUtilization()` prior to `utilization1`.
110-
* Returns {Object}
110+
* Returns: {Object}
111111
* `idle` {number}
112112
* `active` {number}
113113
* `utilization` {number}
@@ -1476,7 +1476,7 @@ added:
14761476
**Default:** `Number.MAX_SAFE_INTEGER`.
14771477
* `figures` {number} The number of accuracy digits. Must be a number between
14781478
`1` and `5`. **Default:** `3`.
1479-
* Returns {RecordableHistogram}
1479+
* Returns: {RecordableHistogram}
14801480

14811481
Returns a {RecordableHistogram}.
14821482

doc/api/stream.md

+4-9
Original file line numberDiff line numberDiff line change
@@ -2651,10 +2651,8 @@ changes:
26512651
finished before the call to `finished(stream, cb)`.
26522652
-->
26532653

2654-
* `stream` {Stream|ReadableStream|WritableStream}
2655-
2656-
A readable and/or writable stream/webstream.
2657-
2654+
* `stream` {Stream|ReadableStream|WritableStream} A readable and/or writable
2655+
stream/webstream.
26582656
* `options` {Object}
26592657
* `error` {boolean} If set to `false`, then a call to `emit('error', err)` is
26602658
not treated as finished. **Default:** `true`.
@@ -2670,10 +2668,8 @@ A readable and/or writable stream/webstream.
26702668
listeners added by this function will also be removed.
26712669
* `cleanup` {boolean} remove all registered stream listeners.
26722670
**Default:** `false`.
2673-
26742671
* `callback` {Function} A callback function that takes an optional error
26752672
argument.
2676-
26772673
* Returns: {Function} A cleanup function which removes all registered
26782674
listeners.
26792675

@@ -3286,9 +3282,8 @@ changes:
32863282
-->
32873283

32883284
* `signal` {AbortSignal} A signal representing possible cancellation
3289-
* `stream` {Stream|ReadableStream|WritableStream}
3290-
3291-
A stream to attach a signal to.
3285+
* `stream` {Stream|ReadableStream|WritableStream} A stream to attach a signal
3286+
to.
32923287

32933288
Attaches an AbortSignal to a readable or writeable stream. This lets code
32943289
control stream destruction using an `AbortController`.

doc/api/test.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -2825,8 +2825,9 @@ added:
28252825
- v16.17.0
28262826
-->
28272827

2828-
* {AbortSignal} Can be used to abort test subtasks when the test has been
2829-
aborted.
2828+
* Type: {AbortSignal}
2829+
2830+
Can be used to abort test subtasks when the test has been aborted.
28302831

28312832
```js
28322833
test('top level test', async (t) => {
@@ -2971,8 +2972,9 @@ added:
29712972
- v16.17.0
29722973
-->
29732974

2974-
* {AbortSignal} Can be used to abort test subtasks when the test has been
2975-
aborted.
2975+
* Type: {AbortSignal}
2976+
2977+
Can be used to abort test subtasks when the test has been aborted.
29762978

29772979
[TAP]: https://testanything.org/
29782980
[TTY]: tty.md

doc/api/tls.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ changes:
16511651
* hint: {string} optional message sent from the server to help client
16521652
decide which identity to use during negotiation.
16531653
Always `null` if TLS 1.3 is used.
1654-
* Returns: {Object} in the form
1654+
* Returns: {Object} An object in the form
16551655
`{ psk: <Buffer|TypedArray|DataView>, identity: <string> }`
16561656
or `null` to stop the negotiation process. `psk` must be
16571657
compatible with the selected cipher's digest.

doc/api/url.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -921,8 +921,8 @@ myURL.searchParams.forEach((value, name, searchParams) => {
921921
#### `urlSearchParams.get(name)`
922922

923923
* `name` {string}
924-
* Returns: {string} or `null` if there is no name-value pair with the given
925-
`name`.
924+
* Returns: {string | null} A string or `null` if there is no name-value pair
925+
with the given `name`.
926926

927927
Returns the value of the first name-value pair whose name is `name`. If there
928928
are no such pairs, `null` is returned.

doc/api/util.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1275,8 +1275,8 @@ is the `name`, the second item of the array is the `value`.
12751275
### `mimeParams.get(name)`
12761276

12771277
* `name` {string}
1278-
* Returns: {string} or `null` if there is no name-value pair with the given
1279-
`name`.
1278+
* Returns: {string | null} A string or `null` if there is no name-value pair
1279+
with the given `name`.
12801280

12811281
Returns the value of the first name-value pair whose name is `name`. If there
12821282
are no such pairs, `null` is returned.

0 commit comments

Comments
 (0)