Skip to content

Commit bdc2c3b

Browse files
karlhorkyaduh95
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 41f68f5 commit bdc2c3b

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
@@ -688,6 +688,7 @@ changes:
688688
with. **Default:** `0`.
689689
* `encoding` {string} If `fill` is a string, this is its encoding.
690690
**Default:** `'utf8'`.
691+
* Returns: {Buffer}
691692

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

784785
* `size` {integer} The desired length of the new `Buffer`.
786+
* Returns: {Buffer}
785787

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

854856
* `size` {integer} The desired length of the new `Buffer`.
857+
* Returns: {Buffer}
855858

856859
Allocates a new `Buffer` of `size` bytes. If `size` is larger than
857860
[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_OUT_OF_RANGE`][]
@@ -1098,6 +1101,7 @@ added:
10981101
* `offset` {integer} The starting offset within `view`. **Default:**: `0`.
10991102
* `length` {integer} The number of elements from `view` to copy.
11001103
**Default:** `view.length - offset`.
1104+
* Returns: {Buffer}
11011105

11021106
Copies the underlying memory of `view` into a new `Buffer`.
11031107

@@ -1117,6 +1121,7 @@ added: v5.10.0
11171121
-->
11181122

11191123
* `array` {integer\[]}
1124+
* Returns: {Buffer}
11201125

11211126
Allocates a new `Buffer` using an `array` of bytes in the range `0``255`.
11221127
Array entries outside that range will be truncated to fit into it.
@@ -1159,6 +1164,7 @@ added: v5.10.0
11591164
* `byteOffset` {integer} Index of first byte to expose. **Default:** `0`.
11601165
* `length` {integer} Number of bytes to expose.
11611166
**Default:** `arrayBuffer.byteLength - byteOffset`.
1167+
* Returns: {Buffer}
11621168

11631169
This creates a view of the [`ArrayBuffer`][] without copying the underlying
11641170
memory. For example, when passed a reference to the `.buffer` property of a
@@ -1271,6 +1277,7 @@ added: v5.10.0
12711277

12721278
* `buffer` {Buffer|Uint8Array} An existing `Buffer` or [`Uint8Array`][] from
12731279
which to copy data.
1280+
* Returns: {Buffer}
12741281

12751282
Copies the passed `buffer` data onto a new `Buffer` instance.
12761283

@@ -1314,6 +1321,7 @@ added: v8.2.0
13141321
* `object` {Object} An object supporting `Symbol.toPrimitive` or `valueOf()`.
13151322
* `offsetOrEncoding` {integer|string} A byte-offset or encoding.
13161323
* `length` {integer} A length.
1324+
* Returns: {Buffer}
13171325

13181326
For objects whose `valueOf()` function returns a value not strictly equal to
13191327
`object`, returns `Buffer.from(object.valueOf(), offsetOrEncoding, length)`.
@@ -1372,6 +1380,7 @@ added: v5.10.0
13721380

13731381
* `string` {string} A string to encode.
13741382
* `encoding` {string} The encoding of `string`. **Default:** `'utf8'`.
1383+
* Returns: {Buffer}
13751384

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

0 commit comments

Comments
 (0)