Skip to content

Commit d33520c

Browse files
silverwindMylesBorins
authored andcommitted
doc: consistent 'Returns:'
For consistency, changed all `Return:` to `Returns:` in the API docs. PR-URL: #9554 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent c87ccfa commit d33520c

File tree

7 files changed

+72
-72
lines changed

7 files changed

+72
-72
lines changed

‎doc/api/buffer.md‎

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ added: v0.1.90
612612
calculate the length of
613613
*`encoding`{String} If `string` is a string, this is its encoding.
614614
**Default:**`'utf8'`
615-
*Return:{Integer} The number of bytes contained within `string`
615+
*Returns:{Integer} The number of bytes contained within `string`
616616

617617
Returns the actual byte length of a string. This is not the same as
618618
[`String.prototype.length`] since that returns the number of *characters* in
@@ -640,7 +640,7 @@ added: v0.11.13
640640

641641
*`buf1`{Buffer}
642642
*`buf2`{Buffer}
643-
*Return:{Integer}
643+
*Returns:{Integer}
644644

645645
Compares `buf1` to `buf2` typically for the purpose of sorting arrays of
646646
`Buffer` instances. This is equivalent to calling
@@ -666,7 +666,7 @@ added: v0.7.11
666666
*`list`{Array} List of `Buffer` instances to concat
667667
*`totalLength`{Integer} Total length of the `Buffer` instances in `list`
668668
when concatenated
669-
*Return:{Buffer}
669+
*Returns:{Buffer}
670670

671671
Returns a new `Buffer` which is the result of concatenating all the `Buffer`
672672
instances in the `list` together.
@@ -831,7 +831,7 @@ added: v0.1.101
831831
-->
832832

833833
*`obj`{Object}
834-
*Return:{Boolean}
834+
*Returns:{Boolean}
835835

836836
Returns `true` if `obj` is a `Buffer`, `false` otherwise.
837837

@@ -841,7 +841,7 @@ added: v0.9.1
841841
-->
842842

843843
*`encoding`{String} A character encoding name to check
844-
*Return:{Boolean}
844+
*Returns:{Boolean}
845845

846846
Returns `true` if `encoding` contains a supported character encoding, or `false`
847847
otherwise.
@@ -896,7 +896,7 @@ added: v0.11.13
896896
*`sourceEnd`{Integer} The offset within `buf` at which to end comparison
897897
(not inclusive). Ignored when `targetStart` is `undefined`.
898898
**Default:**[`buf.length`]
899-
*Return:{Integer}
899+
*Returns:{Integer}
900900

901901
Compares `buf` with `target` and returns a number indicating whether `buf`
902902
comes before, after, or is the same as `target` in sort order.
@@ -968,7 +968,7 @@ added: v0.1.90
968968
Ignored when `targetStart` is `undefined`. **Default:**`0`
969969
*`sourceEnd`{Integer} The offset within `buf` at which to stop copying (not
970970
inclusive). Ignored when `sourceStart` is `undefined`. **Default:**[`buf.length`]
971-
*Return:{Integer} The number of bytes copied.
971+
*Returns:{Integer} The number of bytes copied.
972972

973973
Copies data from a region of `buf` to a region in `target` even if the `target`
974974
memory region overlaps with `buf`.
@@ -1013,7 +1013,7 @@ console.log(buf.toString());
10131013
added: v1.1.0
10141014
-->
10151015

1016-
*Return:{Iterator}
1016+
*Returns:{Iterator}
10171017

10181018
Creates and returns an [iterator] of `[index, byte]` pairs from the contents of
10191019
`buf`.
@@ -1041,7 +1041,7 @@ added: v0.11.13
10411041
-->
10421042

10431043
*`otherBuffer`{Buffer} A `Buffer` to compare to
1044-
*Return:{Boolean}
1044+
*Returns:{Boolean}
10451045

10461046
Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,
10471047
`false` otherwise.
@@ -1070,7 +1070,7 @@ added: v0.5.0
10701070
*`end`{Integer} Where to stop filling `buf` (not inclusive). **Default:**[`buf.length`]
10711071
*`encoding`{String} If `value` is a string, this is its encoding.
10721072
**Default:**`'utf8'`
1073-
*Return:{Buffer} A reference to `buf`
1073+
*Returns:{Buffer} A reference to `buf`
10741074

10751075
Fills `buf` with the specified `value`. If the `offset` and `end` are not given,
10761076
the entire `buf` will be filled. This is meant to be a small simplification to
@@ -1106,7 +1106,7 @@ added: v1.5.0
11061106
*`byteOffset`{Integer} Where to begin searching in `buf`. **Default:**`0`
11071107
*`encoding`{String} If `value` is a string, this is its encoding.
11081108
**Default:**`'utf8'`
1109-
*Return:{Integer} The index of the first occurrence of `value` in `buf` or `-1`
1109+
*Returns:{Integer} The index of the first occurrence of `value` in `buf` or `-1`
11101110
if `buf` does not contain `value`
11111111

11121112
If `value` is:
@@ -1161,7 +1161,7 @@ added: v5.3.0
11611161
*`byteOffset`{Integer} Where to begin searching in `buf`. **Default:**`0`
11621162
*`encoding`{String} If `value` is a string, this is its encoding.
11631163
**Default:**`'utf8'`
1164-
*Return:{Boolean} `true` if `value` was found in `buf`, `false` otherwise
1164+
*Returns:{Boolean} `true` if `value` was found in `buf`, `false` otherwise
11651165

11661166
Equivalent to [`buf.indexOf() !== -1`][`buf.indexOf()`].
11671167

@@ -1198,7 +1198,7 @@ console.log(buf.includes('this', 4));
11981198
added: v1.1.0
11991199
-->
12001200

1201-
*Return:{Iterator}
1201+
*Returns:{Iterator}
12021202

12031203
Creates and returns an [iterator] of `buf` keys (indices).
12041204

@@ -1229,7 +1229,7 @@ added: v6.0.0
12291229
**Default:**[`buf.length`]
12301230
*`encoding`{String} If `value` is a string, this is its encoding.
12311231
**Default:**`'utf8'`
1232-
*Return:{Integer} The index of the last occurrence of `value` in `buf` or `-1`
1232+
*Returns:{Integer} The index of the last occurrence of `value` in `buf` or `-1`
12331233
if `buf` does not contain `value`
12341234

12351235
Identical to [`buf.indexOf()`], except `buf` is searched from back to front
@@ -1325,7 +1325,7 @@ added: v0.11.15
13251325

13261326
*`offset`{Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 8`
13271327
*`noAssert`{Boolean} Skip `offset` validation? **Default:**`false`
1328-
*Return:{Number}
1328+
*Returns:{Number}
13291329

13301330
Reads a 64-bit double from `buf` at the specified `offset` with specified
13311331
endian format (`readDoubleBE()` returns big endian, `readDoubleLE()` returns
@@ -1361,7 +1361,7 @@ added: v0.11.15
13611361

13621362
*`offset`{Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4`
13631363
*`noAssert`{Boolean} Skip `offset` validation? **Default:**`false`
1364-
*Return:{Number}
1364+
*Returns:{Number}
13651365

13661366
Reads a 32-bit float from `buf` at the specified `offset` with specified
13671367
endian format (`readFloatBE()` returns big endian, `readFloatLE()` returns
@@ -1396,7 +1396,7 @@ added: v0.5.0
13961396

13971397
*`offset`{Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1`
13981398
*`noAssert`{Boolean} Skip `offset` validation? **Default:**`false`
1399-
*Return:{Integer}
1399+
*Returns:{Integer}
14001400

14011401
Reads a signed 8-bit integer from `buf` at the specified `offset`.
14021402

@@ -1428,7 +1428,7 @@ added: v0.5.5
14281428

14291429
*`offset`{Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2`
14301430
*`noAssert`{Boolean} Skip `offset` validation? **Default:**`false`
1431-
*Return:{Integer}
1431+
*Returns:{Integer}
14321432

14331433
Reads a signed 16-bit integer from `buf` at the specified `offset` with
14341434
the specified endian format (`readInt16BE()` returns big endian,
@@ -1462,7 +1462,7 @@ added: v0.5.5
14621462

14631463
*`offset`{Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4`
14641464
*`noAssert`{Boolean} Skip `offset` validation? **Default:**`false`
1465-
*Return:{Integer}
1465+
*Returns:{Integer}
14661466

14671467
Reads a signed 32-bit integer from `buf` at the specified `offset` with
14681468
the specified endian format (`readInt32BE()` returns big endian,
@@ -1497,7 +1497,7 @@ added: v0.11.15
14971497
*`offset`{Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength`
14981498
*`byteLength`{Integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6`
14991499
*`noAssert`{Boolean} Skip `offset` and `byteLength` validation? **Default:**`false`
1500-
*Return:{Integer}
1500+
*Returns:{Integer}
15011501

15021502
Reads `byteLength` number of bytes from `buf` at the specified `offset`
15031503
and interprets the result as a two's complement signed value. Supports up to 48
@@ -1528,7 +1528,7 @@ added: v0.5.0
15281528

15291529
*`offset`{Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 1`
15301530
*`noAssert`{Boolean} Skip `offset` validation? **Default:**`false`
1531-
*Return:{Integer}
1531+
*Returns:{Integer}
15321532

15331533
Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
15341534

@@ -1558,7 +1558,7 @@ added: v0.5.5
15581558

15591559
*`offset`{Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 2`
15601560
*`noAssert`{Boolean} Skip `offset` validation? **Default:**`false`
1561-
*Return:{Integer}
1561+
*Returns:{Integer}
15621562

15631563
Reads an unsigned 16-bit integer from `buf` at the specified `offset` with
15641564
specified endian format (`readUInt16BE()` returns big endian, `readUInt16LE()`
@@ -1596,7 +1596,7 @@ added: v0.5.5
15961596

15971597
*`offset`{Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - 4`
15981598
*`noAssert`{Boolean} Skip `offset` validation? **Default:**`false`
1599-
*Return:{Integer}
1599+
*Returns:{Integer}
16001600

16011601
Reads an unsigned 32-bit integer from `buf` at the specified `offset` with
16021602
specified endian format (`readUInt32BE()` returns big endian,
@@ -1629,7 +1629,7 @@ added: v0.11.15
16291629
*`offset`{Integer} Where to start reading. Must satisfy: `0 <= offset <= buf.length - byteLength`
16301630
*`byteLength`{Integer} How many bytes to read. Must satisfy: `0 < byteLength <= 6`
16311631
*`noAssert`{Boolean} Skip `offset` and `byteLength` validation? **Default:**`false`
1632-
*Return:{Integer}
1632+
*Returns:{Integer}
16331633

16341634
Reads `byteLength` number of bytes from `buf` at the specified `offset`
16351635
and interprets the result as an unsigned integer. Supports up to 48
@@ -1661,7 +1661,7 @@ added: v0.3.0
16611661
*`start`{Integer} Where the new `Buffer` will start. **Default:**`0`
16621662
*`end`{Integer} Where the new `Buffer` will end (not inclusive).
16631663
**Default:**[`buf.length`]
1664-
*Return:{Buffer}
1664+
*Returns:{Buffer}
16651665

16661666
Returns a new `Buffer` that references the same memory as the original, but
16671667
offset and cropped by the `start` and `end` indices.
@@ -1717,7 +1717,7 @@ console.log(buf.slice(-5, -2).toString());
17171717
added: v5.10.0
17181718
-->
17191719

1720-
*Return:{Buffer} A reference to `buf`
1720+
*Returns:{Buffer} A reference to `buf`
17211721

17221722
Interprets `buf` as an array of unsigned 16-bit integers and swaps the byte-order
17231723
*in-place*. Throws a `RangeError` if [`buf.length`] is not a multiple of 2.
@@ -1747,7 +1747,7 @@ buf2.swap32();
17471747
added: v5.10.0
17481748
-->
17491749

1750-
*Return:{Buffer} A reference to `buf`
1750+
*Returns:{Buffer} A reference to `buf`
17511751

17521752
Interprets `buf` as an array of unsigned 32-bit integers and swaps the byte-order
17531753
*in-place*. Throws a `RangeError` if [`buf.length`] is not a multiple of 4.
@@ -1777,7 +1777,7 @@ buf2.swap32();
17771777
added: v6.3.0
17781778
-->
17791779

1780-
*Return:{Buffer} A reference to `buf`
1780+
*Returns:{Buffer} A reference to `buf`
17811781

17821782
Interprets `buf` as an array of 64-bit numbers and swaps the byte-order *in-place*.
17831783
Throws a `RangeError` if [`buf.length`] is not a multiple of 8.
@@ -1814,7 +1814,7 @@ added: v0.1.90
18141814
*`start`{Integer} The byte offset to start decoding at. **Default:**`0`
18151815
*`end`{Integer} The byte offset to stop decoding at (not inclusive).
18161816
**Default:**[`buf.length`]
1817-
*Return:{String}
1817+
*Returns:{String}
18181818

18191819
Decodes `buf` to a string according to the specified character encoding in
18201820
`encoding`. `start` and `end` may be passed to decode only a subset of `buf`.
@@ -1853,7 +1853,7 @@ console.log(buf2.toString(undefined, 0, 3));
18531853
added: v0.9.2
18541854
-->
18551855

1856-
*Return:{Object}
1856+
*Returns:{Object}
18571857

18581858
Returns a JSON representation of `buf`. [`JSON.stringify()`] implicitly calls
18591859
this function when stringifying a `Buffer` instance.
@@ -1882,7 +1882,7 @@ console.log(copy);
18821882
added: v1.1.0
18831883
-->
18841884

1885-
*Return:{Iterator}
1885+
*Returns:{Iterator}
18861886

18871887
Creates and returns an [iterator] for `buf` values (bytes). This function is
18881888
called automatically when a `Buffer` is used in a `for..of` statement.
@@ -1924,7 +1924,7 @@ added: v0.1.90
19241924
*`offset`{Integer} Where to start writing `string`. **Default:**`0`
19251925
*`length`{Integer} How many bytes to write. **Default:**`buf.length - offset`
19261926
*`encoding`{String} The character encoding of `string`. **Default:**`'utf8'`
1927-
*Return:{Integer} Number of bytes written
1927+
*Returns:{Integer} Number of bytes written
19281928

19291929
Writes `string` to `buf` at `offset` according to the character encoding in `encoding`.
19301930
The `length` parameter is the number of bytes to write. If `buf` did not contain
@@ -1951,7 +1951,7 @@ added: v0.11.15
19511951
*`value`{Number} Number to be written to `buf`
19521952
*`offset`{Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 8`
19531953
*`noAssert`{Boolean} Skip `value` and `offset` validation? **Default:**`false`
1954-
*Return:{Integer} `offset` plus the number of bytes written
1954+
*Returns:{Integer} `offset` plus the number of bytes written
19551955

19561956
Writes `value` to `buf` at the specified `offset` with specified endian
19571957
format (`writeDoubleBE()` writes big endian, `writeDoubleLE()` writes little
@@ -1986,7 +1986,7 @@ added: v0.11.15
19861986
*`value`{Number} Number to be written to `buf`
19871987
*`offset`{Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4`
19881988
*`noAssert`{Boolean} Skip `value` and `offset` validation? **Default:**`false`
1989-
*Return:{Integer} `offset` plus the number of bytes written
1989+
*Returns:{Integer} `offset` plus the number of bytes written
19901990

19911991
Writes `value` to `buf` at the specified `offset` with specified endian
19921992
format (`writeFloatBE()` writes big endian, `writeFloatLE()` writes little
@@ -2020,7 +2020,7 @@ added: v0.5.0
20202020
*`value`{Integer} Number to be written to `buf`
20212021
*`offset`{Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1`
20222022
*`noAssert`{Boolean} Skip `value` and `offset` validation? **Default:**`false`
2023-
*Return:{Integer} `offset` plus the number of bytes written
2023+
*Returns:{Integer} `offset` plus the number of bytes written
20242024

20252025
Writes `value` to `buf` at the specified `offset`. `value`*should* be a valid
20262026
signed 8-bit integer. Behavior is undefined when `value` is anything other than
@@ -2052,7 +2052,7 @@ added: v0.5.5
20522052
*`value`{Integer} Number to be written to `buf`
20532053
*`offset`{Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2`
20542054
*`noAssert`{Boolean} Skip `value` and `offset` validation? **Default:**`false`
2055-
*Return:{Integer} `offset` plus the number of bytes written
2055+
*Returns:{Integer} `offset` plus the number of bytes written
20562056

20572057
Writes `value` to `buf` at the specified `offset` with specified endian
20582058
format (`writeInt16BE()` writes big endian, `writeInt16LE()` writes little
@@ -2085,7 +2085,7 @@ added: v0.5.5
20852085
*`value`{Integer} Number to be written to `buf`
20862086
*`offset`{Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4`
20872087
*`noAssert`{Boolean} Skip `value` and `offset` validation? **Default:**`false`
2088-
*Return:{Integer} `offset` plus the number of bytes written
2088+
*Returns:{Integer} `offset` plus the number of bytes written
20892089

20902090
Writes `value` to `buf` at the specified `offset` with specified endian
20912091
format (`writeInt32BE()` writes big endian, `writeInt32LE()` writes little
@@ -2120,7 +2120,7 @@ added: v0.11.15
21202120
*`byteLength`{Integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6`
21212121
*`noAssert`{Boolean} Skip `value`, `offset`, and `byteLength` validation?
21222122
**Default:**`false`
2123-
*Return:{Integer} `offset` plus the number of bytes written
2123+
*Returns:{Integer} `offset` plus the number of bytes written
21242124

21252125
Writes `byteLength` bytes of `value` to `buf` at the specified `offset`.
21262126
Supports up to 48 bits of accuracy. Behavior is undefined when `value` is
@@ -2153,7 +2153,7 @@ added: v0.5.0
21532153
*`value`{Integer} Number to be written to `buf`
21542154
*`offset`{Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 1`
21552155
*`noAssert`{Boolean} Skip `value` and `offset` validation? **Default:**`false`
2156-
*Return:{Integer} `offset` plus the number of bytes written
2156+
*Returns:{Integer} `offset` plus the number of bytes written
21572157

21582158
Writes `value` to `buf` at the specified `offset`. `value`*should* be a
21592159
valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
@@ -2185,7 +2185,7 @@ added: v0.5.5
21852185
*`value`{Integer} Number to be written to `buf`
21862186
*`offset`{Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 2`
21872187
*`noAssert`{Boolean} Skip `value` and `offset` validation? **Default:**`false`
2188-
*Return:{Integer} `offset` plus the number of bytes written
2188+
*Returns:{Integer} `offset` plus the number of bytes written
21892189

21902190
Writes `value` to `buf` at the specified `offset` with specified endian
21912191
format (`writeUInt16BE()` writes big endian, `writeUInt16LE()` writes little
@@ -2222,7 +2222,7 @@ added: v0.5.5
22222222
*`value`{Integer} Number to be written to `buf`
22232223
*`offset`{Integer} Where to start writing. Must satisfy: `0 <= offset <= buf.length - 4`
22242224
*`noAssert`{Boolean} Skip `value` and `offset` validation? **Default:**`false`
2225-
*Return:{Integer} `offset` plus the number of bytes written
2225+
*Returns:{Integer} `offset` plus the number of bytes written
22262226

22272227
Writes `value` to `buf` at the specified `offset` with specified endian
22282228
format (`writeUInt32BE()` writes big endian, `writeUInt32LE()` writes little
@@ -2259,7 +2259,7 @@ added: v0.5.5
22592259
*`byteLength`{Integer} How many bytes to write. Must satisfy: `0 < byteLength <= 6`
22602260
*`noAssert`{Boolean} Skip `value`, `offset`, and `byteLength` validation?
22612261
**Default:**`false`
2262-
*Return:{Integer} `offset` plus the number of bytes written
2262+
*Returns:{Integer} `offset` plus the number of bytes written
22632263

22642264
Writes `byteLength` bytes of `value` to `buf` at the specified `offset`.
22652265
Supports up to 48 bits of accuracy. Behavior is undefined when `value` is

0 commit comments

Comments
(0)