Skip to content

Commit dff2141

Browse files
committed
doc: specify definite Array types
Replace `{Array}` with `{type[]}`. PR-URL: #19895 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 321c178 commit dff2141

File tree

16 files changed

+41
-36
lines changed

16 files changed

+41
-36
lines changed

doc/api/buffer.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,8 @@ changes:
712712
description: The elements of `list` can now be `Uint8Array`s.
713713
-->
714714

715-
* `list` {Array} List of `Buffer` or [`Uint8Array`] instances to concat.
715+
* `list` {Buffer[] | Uint8Array[]} List of `Buffer` or [`Uint8Array`] instances
716+
to concat.
716717
* `totalLength` {integer} Total length of the `Buffer` instances in `list`
717718
when concatenated.
718719
* Returns: {Buffer}
@@ -756,7 +757,7 @@ console.log(bufA.length);
756757
added: v5.10.0
757758
-->
758759

759-
* `array` {Array}
760+
* `array` {integer[]}
760761

761762
Allocates a new `Buffer` using an `array` of octets.
762763

doc/api/child_process.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,12 @@ changes:
322322
-->
323323

324324
* `modulePath` {string} The module to run in the child.
325-
* `args` {Array} List of string arguments.
325+
* `args` {string[]} List of string arguments.
326326
* `options` {Object}
327327
* `cwd` {string} Current working directory of the child process.
328328
* `env` {Object} Environment key-value pairs.
329329
* `execPath` {string} Executable used to create the child process.
330-
* `execArgv` {Array} List of string arguments passed to the executable.
330+
* `execArgv` {string[]} List of string arguments passed to the executable.
331331
**Default:** `process.execArgv`.
332332
* `silent` {boolean} If `true`, stdin, stdout, and stderr of the child will be
333333
piped to the parent, otherwise they will be inherited from the parent, see
@@ -387,7 +387,7 @@ changes:
387387
-->
388388

389389
* `command` {string} The command to run.
390-
* `args` {Array} List of string arguments.
390+
* `args` {string[]} List of string arguments.
391391
* `options` {Object}
392392
* `cwd` {string} Current working directory of the child process.
393393
* `env` {Object} Environment key-value pairs.
@@ -803,7 +803,7 @@ changes:
803803
-->
804804

805805
* `command` {string} The command to run.
806-
* `args` {Array} List of string arguments.
806+
* `args` {string[]} List of string arguments.
807807
* `options` {Object}
808808
* `cwd` {string} Current working directory of the child process.
809809
* `input` {string|Buffer|Uint8Array} The value which will be passed as stdin

doc/api/cluster.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,10 @@ changes:
713713
-->
714714

715715
* {Object}
716-
* `execArgv` {Array} List of string arguments passed to the Node.js
716+
* `execArgv` {string[]} List of string arguments passed to the Node.js
717717
executable. **Default:** `process.execArgv`.
718718
* `exec` {string} File path to worker file. **Default:** `process.argv[1]`.
719-
* `args` {Array} String arguments passed to worker.
719+
* `args` {string[]} String arguments passed to worker.
720720
**Default:** `process.argv.slice(2)`.
721721
* `cwd` {string} Current working directory of the worker process. **Default:**
722722
`undefined` (inherits from parent process).

doc/api/console.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,8 @@ the report to the **Profiles** panel of the inspector. See
479479
added: v8.0.0
480480
-->
481481
* `array` {Array|Object}
482-
* `columns` {Array}
482+
* `columns` {string[]} Display only selected properties of objects in the
483+
`array`.
483484

484485
This method does not display anything unless used in the inspector. Prints to
485486
`stdout` the array `array` formatted as a table.

doc/api/fs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2319,7 +2319,7 @@ changes:
23192319
* `path` {string|Buffer|URL}
23202320
* `options` {string|Object}
23212321
* `encoding` {string} **Default:** `'utf8'`
2322-
* Returns: {Array} An array of filenames
2322+
* Returns: {string[]} An array of filenames
23232323

23242324
Synchronous readdir(3). Returns an array of filenames excluding `'.'` and
23252325
`'..'`.

doc/api/http.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ const contentType = response.getHeader('content-type');
11031103
added: v7.7.0
11041104
-->
11051105

1106-
* Returns: {Array}
1106+
* Returns: {string[]}
11071107

11081108
Returns an array containing the unique names of the current outgoing headers.
11091109
All header names are lowercase.
@@ -1538,7 +1538,7 @@ The request method as a string. Read only. Example:
15381538
added: v0.11.6
15391539
-->
15401540

1541-
* {Array}
1541+
* {string[]}
15421542

15431543
The raw request/response headers list exactly as they were received.
15441544

@@ -1567,7 +1567,7 @@ console.log(request.rawHeaders);
15671567
added: v0.11.6
15681568
-->
15691569

1570-
* {Array}
1570+
* {string[]}
15711571

15721572
The raw request/response trailer keys and values exactly as they were
15731573
received. Only populated at the `'end'` event.
@@ -1702,7 +1702,7 @@ Url {
17021702
added: v0.11.8
17031703
-->
17041704

1705-
* {Array}
1705+
* {string[]}
17061706

17071707
A list of the HTTP methods that are supported by the parser.
17081708

doc/api/http2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,7 +2437,7 @@ The request method as a string. Read-only. Example:
24372437
added: v8.4.0
24382438
-->
24392439

2440-
* {Array}
2440+
* {string[]}
24412441

24422442
The raw request/response headers list exactly as they were received.
24432443

@@ -2466,7 +2466,7 @@ console.log(request.rawHeaders);
24662466
added: v8.4.0
24672467
-->
24682468

2469-
* {Array}
2469+
* {string[]}
24702470

24712471
The raw request/response trailer keys and values exactly as they were
24722472
received. Only populated at the `'end'` event.
@@ -2710,7 +2710,7 @@ const contentType = response.getHeader('content-type');
27102710
added: v8.4.0
27112711
-->
27122712

2713-
* Returns: {Array}
2713+
* Returns: {string[]}
27142714

27152715
Returns an array containing the unique names of the current outgoing headers.
27162716
All header names are lowercase.

doc/api/modules.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ changes:
648648

649649
* `request` {string} The module path to resolve.
650650
* `options` {Object}
651-
* `paths` {Array} Paths to resolve module location from. If present, these
651+
* `paths` {string[]} Paths to resolve module location from. If present, these
652652
paths are used instead of the default resolution paths. Note that each of
653653
these paths is used as a starting point for the module resolution algorithm,
654654
meaning that the `node_modules` hierarchy is checked from this location.
@@ -663,7 +663,7 @@ added: v8.9.0
663663
-->
664664

665665
* `request` {string} The module path whose lookup paths are being retrieved.
666-
* Returns: {Array|null}
666+
* Returns: {string[]|null}
667667

668668
Returns an array containing the paths searched during resolution of `request` or
669669
null if the `request` string references a core module, for example `http` or
@@ -689,7 +689,7 @@ a global but rather local to each module.
689689
added: v0.1.16
690690
-->
691691

692-
* {Array}
692+
* {module[]}
693693

694694
The module objects required by this one.
695695

doc/api/os.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ defined are described in [OS Constants](#os_os_constants_1).
5454
added: v0.3.3
5555
-->
5656

57-
* Returns: {Array}
57+
* Returns: {Object[]}
5858

5959
The `os.cpus()` method returns an array of objects containing information about
6060
each logical CPU core.
@@ -217,7 +217,7 @@ string.
217217
added: v0.3.3
218218
-->
219219

220-
* Returns: {Array}
220+
* Returns: {number[]}
221221

222222
The `os.loadavg()` method returns an array containing the 1, 5, and 15 minute
223223
load averages.

doc/api/perf_hooks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ The `PerformanceObserverEntryList` class is used to provide access to the
396396
added: v8.5.0
397397
-->
398398

399-
* Returns: {Array}
399+
* Returns: {PerformanceEntry[]}
400400

401401
Returns a list of `PerformanceEntry` objects in chronological order
402402
with respect to `performanceEntry.startTime`.
@@ -408,7 +408,7 @@ added: v8.5.0
408408

409409
* `name` {string}
410410
* `type` {string}
411-
* Returns: {Array}
411+
* Returns: {PerformanceEntry[]}
412412

413413
Returns a list of `PerformanceEntry` objects in chronological order
414414
with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
@@ -421,7 +421,7 @@ added: v8.5.0
421421
-->
422422

423423
* `type` {string}
424-
* Returns: {Array}
424+
* Returns: {PerformanceEntry[]}
425425

426426
Returns a list of `PerformanceEntry` objects in chronological order
427427
with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`
@@ -438,7 +438,7 @@ Disconnects the `PerformanceObserver` instance from all notifications.
438438
added: v8.5.0
439439
-->
440440
* `options` {Object}
441-
* `entryTypes` {Array} An array of strings identifying the types of
441+
* `entryTypes` {string[]} An array of strings identifying the types of
442442
`PerformanceEntry` instances the observer is interested in. If not
443443
provided an error will be thrown.
444444
* `buffered` {boolean} If true, the notification callback will be

0 commit comments

Comments
 (0)