Skip to content

Commit de8de54

Browse files
karlhorkymarco-ippolito
authored andcommitted
doc: add missing return values in buffer docs
PR-URL: #55273 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent a5df708 commit de8de54

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/api/buffer.md

+9
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ changes:
687687
with. **Default:** `0`.
688688
* `encoding` {string} If `fill` is a string, this is its encoding.
689689
**Default:** `'utf8'`.
690+
* Returns: {Buffer}
690691

691692
Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the
692693
`Buffer` will be zero-filled.
@@ -781,6 +782,7 @@ changes:
781782
-->
782783

783784
* `size` {integer} The desired length of the new `Buffer`.
785+
* Returns: {Buffer}
784786

785787
Allocates a new `Buffer` of `size` bytes. If `size` is larger than
786788
[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_OUT_OF_RANGE`][]
@@ -851,6 +853,7 @@ changes:
851853
-->
852854

853855
* `size` {integer} The desired length of the new `Buffer`.
856+
* Returns: {Buffer}
854857

855858
Allocates a new `Buffer` of `size` bytes. If `size` is larger than
856859
[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_OUT_OF_RANGE`][]
@@ -1095,6 +1098,7 @@ added: v19.8.0
10951098
* `offset` {integer} The starting offset within `view`. **Default:**: `0`.
10961099
* `length` {integer} The number of elements from `view` to copy.
10971100
**Default:** `view.length - offset`.
1101+
* Returns: {Buffer}
10981102

10991103
Copies the underlying memory of `view` into a new `Buffer`.
11001104

@@ -1114,6 +1118,7 @@ added: v5.10.0
11141118
-->
11151119

11161120
* `array` {integer\[]}
1121+
* Returns: {Buffer}
11171122

11181123
Allocates a new `Buffer` using an `array` of bytes in the range `0``255`.
11191124
Array entries outside that range will be truncated to fit into it.
@@ -1156,6 +1161,7 @@ added: v5.10.0
11561161
* `byteOffset` {integer} Index of first byte to expose. **Default:** `0`.
11571162
* `length` {integer} Number of bytes to expose.
11581163
**Default:** `arrayBuffer.byteLength - byteOffset`.
1164+
* Returns: {Buffer}
11591165

11601166
This creates a view of the [`ArrayBuffer`][] without copying the underlying
11611167
memory. For example, when passed a reference to the `.buffer` property of a
@@ -1268,6 +1274,7 @@ added: v5.10.0
12681274

12691275
* `buffer` {Buffer|Uint8Array} An existing `Buffer` or [`Uint8Array`][] from
12701276
which to copy data.
1277+
* Returns: {Buffer}
12711278

12721279
Copies the passed `buffer` data onto a new `Buffer` instance.
12731280

@@ -1311,6 +1318,7 @@ added: v8.2.0
13111318
* `object` {Object} An object supporting `Symbol.toPrimitive` or `valueOf()`.
13121319
* `offsetOrEncoding` {integer|string} A byte-offset or encoding.
13131320
* `length` {integer} A length.
1321+
* Returns: {Buffer}
13141322

13151323
For objects whose `valueOf()` function returns a value not strictly equal to
13161324
`object`, returns `Buffer.from(object.valueOf(), offsetOrEncoding, length)`.
@@ -1369,6 +1377,7 @@ added: v5.10.0
13691377

13701378
* `string` {string} A string to encode.
13711379
* `encoding` {string} The encoding of `string`. **Default:** `'utf8'`.
1380+
* Returns: {Buffer}
13721381

13731382
Creates a new `Buffer` containing `string`. The `encoding` parameter identifies
13741383
the character encoding to be used when converting `string` into bytes.

0 commit comments

Comments
 (0)