Skip to content

Commit ff13619

Browse files
committed
doc: consistent case for primitive types
PR-URL: #11167 Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent ebe8c3d commit ff13619

21 files changed

+458
-457
lines changed

doc/api/buffer.md

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,8 @@ changes:
478478
> Stability: 0 - Deprecated:
479479
> Use [`Buffer.from(string[, encoding])`][`Buffer.from(string)`] instead.
480480
481-
* `string` {String} String to encode
482-
* `encoding` {String} The encoding of `string`. **Default:** `'utf8'`
481+
* `string` {string} String to encode
482+
* `encoding` {string} The encoding of `string`. **Default:** `'utf8'`
483483

484484
Creates a new `Buffer` containing the given JavaScript string `string`. If
485485
provided, the `encoding` parameter identifies the character encoding of `string`.
@@ -508,9 +508,9 @@ added: v5.10.0
508508
-->
509509

510510
* `size` {Integer} The desired length of the new `Buffer`
511-
* `fill` {String | Buffer | Integer} A value to pre-fill the new `Buffer` with.
511+
* `fill` {string | Buffer | Integer} A value to pre-fill the new `Buffer` with.
512512
**Default:** `0`
513-
* `encoding` {String} If `fill` is a string, this is its encoding.
513+
* `encoding` {string} If `fill` is a string, this is its encoding.
514514
**Default:** `'utf8'`
515515

516516
Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the
@@ -674,9 +674,9 @@ changes:
674674
or `ArrayBuffer`.
675675
-->
676676

677-
* `string` {String | Buffer | TypedArray | DataView | ArrayBuffer} A value to
677+
* `string` {string | Buffer | TypedArray | DataView | ArrayBuffer} A value to
678678
calculate the length of
679-
* `encoding` {String} If `string` is a string, this is its encoding.
679+
* `encoding` {string} If `string` is a string, this is its encoding.
680680
**Default:** `'utf8'`
681681
* Returns: {Integer} The number of bytes contained within `string`
682682

@@ -876,8 +876,8 @@ A `TypeError` will be thrown if `buffer` is not a `Buffer`.
876876
added: v5.10.0
877877
-->
878878

879-
* `string` {String} A string to encode.
880-
* `encoding` {String} The encoding of `string`. **Default:** `'utf8'`
879+
* `string` {string} A string to encode.
880+
* `encoding` {string} The encoding of `string`. **Default:** `'utf8'`
881881

882882
Creates a new `Buffer` containing the given JavaScript string `string`. If
883883
provided, the `encoding` parameter identifies the character encoding of `string`.
@@ -917,7 +917,7 @@ Returns `true` if `obj` is a `Buffer`, `false` otherwise.
917917
added: v0.9.1
918918
-->
919919

920-
* `encoding` {String} A character encoding name to check
920+
* `encoding` {string} A character encoding name to check
921921
* Returns: {Boolean}
922922

923923
Returns `true` if `encoding` contains a supported character encoding, or `false`
@@ -1170,10 +1170,10 @@ changes:
11701170
description: The `encoding` parameter is supported now.
11711171
-->
11721172

1173-
* `value` {String | Buffer | Integer} The value to fill `buf` with
1173+
* `value` {string | Buffer | Integer} The value to fill `buf` with
11741174
* `offset` {Integer} Where to start filling `buf`. **Default:** `0`
11751175
* `end` {Integer} Where to stop filling `buf` (not inclusive). **Default:** [`buf.length`]
1176-
* `encoding` {String} If `value` is a string, this is its encoding.
1176+
* `encoding` {string} If `value` is a string, this is its encoding.
11771177
**Default:** `'utf8'`
11781178
* Returns: {Buffer} A reference to `buf`
11791179

@@ -1207,9 +1207,9 @@ console.log(Buffer.allocUnsafe(3).fill('\u0222'));
12071207
added: v5.3.0
12081208
-->
12091209

1210-
* `value` {String | Buffer | Integer} What to search for
1210+
* `value` {string | Buffer | Integer} What to search for
12111211
* `byteOffset` {Integer} Where to begin searching in `buf`. **Default:** `0`
1212-
* `encoding` {String} If `value` is a string, this is its encoding.
1212+
* `encoding` {string} If `value` is a string, this is its encoding.
12131213
**Default:** `'utf8'`
12141214
* Returns: {Boolean} `true` if `value` was found in `buf`, `false` otherwise
12151215

@@ -1256,9 +1256,9 @@ changes:
12561256
is no longer required.
12571257
-->
12581258

1259-
* `value` {String | Buffer | Uint8Array | Integer} What to search for
1259+
* `value` {string | Buffer | Uint8Array | Integer} What to search for
12601260
* `byteOffset` {Integer} Where to begin searching in `buf`. **Default:** `0`
1261-
* `encoding` {String} If `value` is a string, this is its encoding.
1261+
* `encoding` {string} If `value` is a string, this is its encoding.
12621262
**Default:** `'utf8'`
12631263
* Returns: {Integer} The index of the first occurrence of `value` in `buf` or `-1`
12641264
if `buf` does not contain `value`
@@ -1365,10 +1365,10 @@ changes:
13651365
description: The `value` can now be a `Uint8Array`.
13661366
-->
13671367

1368-
* `value` {String | Buffer | Uint8Array | Integer} What to search for
1368+
* `value` {string | Buffer | Uint8Array | Integer} What to search for
13691369
* `byteOffset` {Integer} Where to begin searching in `buf`.
13701370
**Default:** [`buf.length`]` - 1`
1371-
* `encoding` {String} If `value` is a string, this is its encoding.
1371+
* `encoding` {string} If `value` is a string, this is its encoding.
13721372
**Default:** `'utf8'`
13731373
* Returns: {Integer} The index of the last occurrence of `value` in `buf` or `-1`
13741374
if `buf` does not contain `value`
@@ -1501,7 +1501,7 @@ added: v0.11.15
15011501
-->
15021502

15031503
* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 8`
1504-
* `noAssert` {Boolean} Skip `offset` validation? **Default:** `false`
1504+
* `noAssert` {boolean} Skip `offset` validation? **Default:** `false`
15051505
* Returns: {Number}
15061506

15071507
Reads a 64-bit double from `buf` at the specified `offset` with specified
@@ -1537,7 +1537,7 @@ added: v0.11.15
15371537
-->
15381538

15391539
* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4`
1540-
* `noAssert` {Boolean} Skip `offset` validation? **Default:** `false`
1540+
* `noAssert` {boolean} Skip `offset` validation? **Default:** `false`
15411541
* Returns: {Number}
15421542

15431543
Reads a 32-bit float from `buf` at the specified `offset` with specified
@@ -1572,7 +1572,7 @@ added: v0.5.0
15721572
-->
15731573

15741574
* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1`
1575-
* `noAssert` {Boolean} Skip `offset` validation? **Default:** `false`
1575+
* `noAssert` {boolean} Skip `offset` validation? **Default:** `false`
15761576
* Returns: {Integer}
15771577

15781578
Reads a signed 8-bit integer from `buf` at the specified `offset`.
@@ -1604,7 +1604,7 @@ added: v0.5.5
16041604
-->
16051605

16061606
* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2`
1607-
* `noAssert` {Boolean} Skip `offset` validation? **Default:** `false`
1607+
* `noAssert` {boolean} Skip `offset` validation? **Default:** `false`
16081608
* Returns: {Integer}
16091609

16101610
Reads a signed 16-bit integer from `buf` at the specified `offset` with
@@ -1638,7 +1638,7 @@ added: v0.5.5
16381638
-->
16391639

16401640
* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4`
1641-
* `noAssert` {Boolean} Skip `offset` validation? **Default:** `false`
1641+
* `noAssert` {boolean} Skip `offset` validation? **Default:** `false`
16421642
* Returns: {Integer}
16431643

16441644
Reads a signed 32-bit integer from `buf` at the specified `offset` with
@@ -1673,7 +1673,7 @@ added: v0.11.15
16731673

16741674
* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength`
16751675
* `byteLength` {Integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6`
1676-
* `noAssert` {Boolean} Skip `offset` and `byteLength` validation? **Default:** `false`
1676+
* `noAssert` {boolean} Skip `offset` and `byteLength` validation? **Default:** `false`
16771677
* Returns: {Integer}
16781678

16791679
Reads `byteLength` number of bytes from `buf` at the specified `offset`
@@ -1704,7 +1704,7 @@ added: v0.5.0
17041704
-->
17051705

17061706
* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1`
1707-
* `noAssert` {Boolean} Skip `offset` validation? **Default:** `false`
1707+
* `noAssert` {boolean} Skip `offset` validation? **Default:** `false`
17081708
* Returns: {Integer}
17091709

17101710
Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
@@ -1734,7 +1734,7 @@ added: v0.5.5
17341734
-->
17351735

17361736
* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2`
1737-
* `noAssert` {Boolean} Skip `offset` validation? **Default:** `false`
1737+
* `noAssert` {boolean} Skip `offset` validation? **Default:** `false`
17381738
* Returns: {Integer}
17391739

17401740
Reads an unsigned 16-bit integer from `buf` at the specified `offset` with
@@ -1772,7 +1772,7 @@ added: v0.5.5
17721772
-->
17731773

17741774
* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4`
1775-
* `noAssert` {Boolean} Skip `offset` validation? **Default:** `false`
1775+
* `noAssert` {boolean} Skip `offset` validation? **Default:** `false`
17761776
* Returns: {Integer}
17771777

17781778
Reads an unsigned 32-bit integer from `buf` at the specified `offset` with
@@ -1805,7 +1805,7 @@ added: v0.11.15
18051805

18061806
* `offset` {Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength`
18071807
* `byteLength` {Integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6`
1808-
* `noAssert` {Boolean} Skip `offset` and `byteLength` validation? **Default:** `false`
1808+
* `noAssert` {boolean} Skip `offset` and `byteLength` validation? **Default:** `false`
18091809
* Returns: {Integer}
18101810

18111811
Reads `byteLength` number of bytes from `buf` at the specified `offset`
@@ -2025,7 +2025,7 @@ console.log(copy);
20252025
added: v0.1.90
20262026
-->
20272027

2028-
* `encoding` {String} The character encoding to decode to. **Default:** `'utf8'`
2028+
* `encoding` {string} The character encoding to decode to. **Default:** `'utf8'`
20292029
* `start` {Integer} The byte offset to start decoding at. **Default:** `0`
20302030
* `end` {Integer} The byte offset to stop decoding at (not inclusive).
20312031
**Default:** [`buf.length`]
@@ -2106,10 +2106,10 @@ for (const value of buf) {
21062106
added: v0.1.90
21072107
-->
21082108

2109-
* `string` {String} String to be written to `buf`
2109+
* `string` {string} String to be written to `buf`
21102110
* `offset` {Integer} Where to start writing `string`. **Default:** `0`
21112111
* `length` {Integer} How many bytes to write. **Default:** `buf.length - offset`
2112-
* `encoding` {String} The character encoding of `string`. **Default:** `'utf8'`
2112+
* `encoding` {string} The character encoding of `string`. **Default:** `'utf8'`
21132113
* Returns: {Integer} Number of bytes written
21142114

21152115
Writes `string` to `buf` at `offset` according to the character encoding in `encoding`.
@@ -2134,9 +2134,9 @@ console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
21342134
added: v0.11.15
21352135
-->
21362136

2137-
* `value` {Number} Number to be written to `buf`
2137+
* `value` {number} Number to be written to `buf`
21382138
* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 8`
2139-
* `noAssert` {Boolean} Skip `value` and `offset` validation? **Default:** `false`
2139+
* `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false`
21402140
* Returns: {Integer} `offset` plus the number of bytes written
21412141

21422142
Writes `value` to `buf` at the specified `offset` with specified endian
@@ -2169,9 +2169,9 @@ console.log(buf);
21692169
added: v0.11.15
21702170
-->
21712171

2172-
* `value` {Number} Number to be written to `buf`
2172+
* `value` {number} Number to be written to `buf`
21732173
* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4`
2174-
* `noAssert` {Boolean} Skip `value` and `offset` validation? **Default:** `false`
2174+
* `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false`
21752175
* Returns: {Integer} `offset` plus the number of bytes written
21762176

21772177
Writes `value` to `buf` at the specified `offset` with specified endian
@@ -2205,7 +2205,7 @@ added: v0.5.0
22052205

22062206
* `value` {Integer} Number to be written to `buf`
22072207
* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1`
2208-
* `noAssert` {Boolean} Skip `value` and `offset` validation? **Default:** `false`
2208+
* `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false`
22092209
* Returns: {Integer} `offset` plus the number of bytes written
22102210

22112211
Writes `value` to `buf` at the specified `offset`. `value` *should* be a valid
@@ -2237,7 +2237,7 @@ added: v0.5.5
22372237

22382238
* `value` {Integer} Number to be written to `buf`
22392239
* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2`
2240-
* `noAssert` {Boolean} Skip `value` and `offset` validation? **Default:** `false`
2240+
* `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false`
22412241
* Returns: {Integer} `offset` plus the number of bytes written
22422242

22432243
Writes `value` to `buf` at the specified `offset` with specified endian
@@ -2270,7 +2270,7 @@ added: v0.5.5
22702270

22712271
* `value` {Integer} Number to be written to `buf`
22722272
* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4`
2273-
* `noAssert` {Boolean} Skip `value` and `offset` validation? **Default:** `false`
2273+
* `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false`
22742274
* Returns: {Integer} `offset` plus the number of bytes written
22752275

22762276
Writes `value` to `buf` at the specified `offset` with specified endian
@@ -2304,7 +2304,7 @@ added: v0.11.15
23042304
* `value` {Integer} Number to be written to `buf`
23052305
* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - byteLength`
23062306
* `byteLength` {Integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6`
2307-
* `noAssert` {Boolean} Skip `value`, `offset`, and `byteLength` validation?
2307+
* `noAssert` {boolean} Skip `value`, `offset`, and `byteLength` validation?
23082308
**Default:** `false`
23092309
* Returns: {Integer} `offset` plus the number of bytes written
23102310

@@ -2338,7 +2338,7 @@ added: v0.5.0
23382338

23392339
* `value` {Integer} Number to be written to `buf`
23402340
* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1`
2341-
* `noAssert` {Boolean} Skip `value` and `offset` validation? **Default:** `false`
2341+
* `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false`
23422342
* Returns: {Integer} `offset` plus the number of bytes written
23432343

23442344
Writes `value` to `buf` at the specified `offset`. `value` *should* be a
@@ -2370,7 +2370,7 @@ added: v0.5.5
23702370

23712371
* `value` {Integer} Number to be written to `buf`
23722372
* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2`
2373-
* `noAssert` {Boolean} Skip `value` and `offset` validation? **Default:** `false`
2373+
* `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false`
23742374
* Returns: {Integer} `offset` plus the number of bytes written
23752375

23762376
Writes `value` to `buf` at the specified `offset` with specified endian
@@ -2407,7 +2407,7 @@ added: v0.5.5
24072407

24082408
* `value` {Integer} Number to be written to `buf`
24092409
* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4`
2410-
* `noAssert` {Boolean} Skip `value` and `offset` validation? **Default:** `false`
2410+
* `noAssert` {boolean} Skip `value` and `offset` validation? **Default:** `false`
24112411
* Returns: {Integer} `offset` plus the number of bytes written
24122412

24132413
Writes `value` to `buf` at the specified `offset` with specified endian
@@ -2443,7 +2443,7 @@ added: v0.5.5
24432443
* `value` {Integer} Number to be written to `buf`
24442444
* `offset` {Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - byteLength`
24452445
* `byteLength` {Integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6`
2446-
* `noAssert` {Boolean} Skip `value`, `offset`, and `byteLength` validation?
2446+
* `noAssert` {boolean} Skip `value`, `offset`, and `byteLength` validation?
24472447
**Default:** `false`
24482448
* Returns: {Integer} `offset` plus the number of bytes written
24492449

@@ -2507,8 +2507,8 @@ changes:
25072507
-->
25082508

25092509
* `source` {Buffer|Uint8Array} A `Buffer` or `Uint8Array` instance
2510-
* `fromEnc` {String} The current encoding
2511-
* `toEnc` {String} To target encoding
2510+
* `fromEnc` {string} The current encoding
2511+
* `toEnc` {string} To target encoding
25122512

25132513
Re-encodes the given `Buffer` or `Uint8Array` instance from one character
25142514
encoding to another. Returns a new `Buffer` instance.

0 commit comments

Comments
 (0)