Skip to content

Commit 519dc8a

Browse files
Semigradskytargos
authored andcommitted
doc: updates for better json generating
PR-URL: #51592 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 1b45ca4 commit 519dc8a

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
@@ -3468,7 +3468,7 @@ added: v19.8.0
34683468
* `path` {string|Buffer|URL}
34693469
* `options` {Object}
34703470
* `type` {string} An optional mime type for the blob.
3471-
* Return: {Promise} containing {Blob}
3471+
* Returns: {Promise} Fulfills with a {Blob} upon success.
34723472
34733473
Returns a {Blob} whose data is backed by the given file.
34743474
@@ -6446,7 +6446,7 @@ The read-only path of this directory as was provided to [`fs.opendir()`][],
64466446
added: v12.12.0
64476447
-->
64486448
6449-
* Returns: {Promise} containing {fs.Dirent|null}
6449+
* Returns: {Promise} Fulfills with a {fs.Dirent|null}
64506450
64516451
Asynchronously read the next directory entry via readdir(3) as an
64526452
{fs.Dirent}.
@@ -6504,7 +6504,7 @@ included in the iteration results.
65046504
added: v12.12.0
65056505
-->
65066506
6507-
* Returns: {AsyncIterator} of {fs.Dirent}
6507+
* Returns: {AsyncIterator} An AsyncIterator of {fs.Dirent}
65086508
65096509
Asynchronously iterates over the directory until all entries have
65106510
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
@@ -1009,16 +1009,16 @@ columnNumber)`
10091009
10101010
* `lineNumber` {number} The 1-indexed line number of the call
10111011
site in the generated source
1012-
* `columnOffset` {number} The 1-indexed column number
1012+
* `columnNumber` {number} The 1-indexed column number
10131013
of the call site in the generated source
10141014
* Returns: {Object}
10151015
1016-
Given a 1-indexed lineNumber and columnNumber from a call site in
1016+
Given a 1-indexed `lineNumber` and `columnNumber` from a call site in
10171017
the generated source, find the corresponding call site location
10181018
in the original source.
10191019
1020-
If the lineNumber and columnNumber provided are not found in any
1021-
source map, then an empty object is returned. Otherwise, the
1020+
If the `lineNumber` and `columnNumber` provided are not found in any
1021+
source map, then an empty object is returned. Otherwise, the
10221022
returned object contains the following keys:
10231023
10241024
* 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
@@ -2647,10 +2647,8 @@ changes:
26472647
finished before the call to `finished(stream, cb)`.
26482648
-->
26492649

2650-
* `stream` {Stream|ReadableStream|WritableStream}
2651-
2652-
A readable and/or writable stream/webstream.
2653-
2650+
* `stream` {Stream|ReadableStream|WritableStream} A readable and/or writable
2651+
stream/webstream.
26542652
* `options` {Object}
26552653
* `error` {boolean} If set to `false`, then a call to `emit('error', err)` is
26562654
not treated as finished. **Default:** `true`.
@@ -2666,10 +2664,8 @@ A readable and/or writable stream/webstream.
26662664
listeners added by this function will also be removed.
26672665
* `cleanup` {boolean} remove all registered stream listeners.
26682666
**Default:** `false`.
2669-
26702667
* `callback` {Function} A callback function that takes an optional error
26712668
argument.
2672-
26732669
* Returns: {Function} A cleanup function which removes all registered
26742670
listeners.
26752671

@@ -3280,9 +3276,8 @@ changes:
32803276
-->
32813277

32823278
* `signal` {AbortSignal} A signal representing possible cancellation
3283-
* `stream` {Stream|ReadableStream|WritableStream}
3284-
3285-
A stream to attach a signal to.
3279+
* `stream` {Stream|ReadableStream|WritableStream} A stream to attach a signal
3280+
to.
32863281

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

doc/api/test.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -2823,8 +2823,9 @@ added:
28232823
- v16.17.0
28242824
-->
28252825

2826-
* {AbortSignal} Can be used to abort test subtasks when the test has been
2827-
aborted.
2826+
* Type: {AbortSignal}
2827+
2828+
Can be used to abort test subtasks when the test has been aborted.
28282829

28292830
```js
28302831
test('top level test', async (t) => {
@@ -2969,8 +2970,9 @@ added:
29692970
- v16.17.0
29702971
-->
29712972

2972-
* {AbortSignal} Can be used to abort test subtasks when the test has been
2973-
aborted.
2973+
* Type: {AbortSignal}
2974+
2975+
Can be used to abort test subtasks when the test has been aborted.
29742976

29752977
[TAP]: https://testanything.org/
29762978
[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)