Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix return value of write methods #5736

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions doc/api/buffer.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
* `value` {Number} Bytes to be written to Buffer
* `offset` {Number} `0 <= offset <= buf.length - 8`
* `noAssert` {Boolean} Default: false
* Return: {Number} Numbers of bytes written
* Return: {Number} The offset plus the number of written bytes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps 'offset' should be surrounded by backticks in each of these changes since it's referencing a parameter.


Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeDoubleBE()` writes big endian, `writeDoubleLE()` writes little
Expand Down Expand Up @@ -1074,7 +1074,7 @@ console.log(buf);
* `value` {Number} Bytes to be written to Buffer
* `offset` {Number} `0 <= offset <= buf.length - 4`
* `noAssert` {Boolean} Default: false
* Return: {Number} Numbers of bytes written
* Return: {Number} The offset plus the number of written bytes

Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeFloatBE()` writes big endian, `writeFloatLE()` writes little
Expand Down Expand Up @@ -1106,7 +1106,7 @@ console.log(buf);
* `value` {Number} Bytes to be written to Buffer
* `offset` {Number} `0 <= offset <= buf.length - 1`
* `noAssert` {Boolean} Default: false
* Return: {Number} Numbers of bytes written
* Return: {Number} The offset plus the number of written bytes

Writes `value` to the Buffer at the specified `offset`. The `value` must be a
valid signed 8-bit integer.
Expand All @@ -1132,7 +1132,7 @@ console.log(buf);
* `value` {Number} Bytes to be written to Buffer
* `offset` {Number} `0 <= offset <= buf.length - 2`
* `noAssert` {Boolean} Default: false
* Return: {Number} Numbers of bytes written
* Return: {Number} The offset plus the number of written bytes

Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeInt16BE()` writes big endian, `writeInt16LE()` writes little
Expand All @@ -1159,7 +1159,7 @@ console.log(buf);
* `value` {Number} Bytes to be written to Buffer
* `offset` {Number} `0 <= offset <= buf.length - 4`
* `noAssert` {Boolean} Default: false
* Return: {Number} Numbers of bytes written
* Return: {Number} The offset plus the number of written bytes

Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeInt32BE()` writes big endian, `writeInt32LE()` writes little
Expand Down Expand Up @@ -1187,7 +1187,7 @@ console.log(buf);
* `offset` {Number} `0 <= offset <= buf.length - byteLength`
* `byteLength` {Number} `0 < byteLength <= 6`
* `noAssert` {Boolean} Default: false
* Return: {Number} Numbers of bytes written
* Return: {Number} The offset plus the number of written bytes

Writes `value` to the Buffer at the specified `offset` and `byteLength`.
Supports up to 48 bits of accuracy. For example:
Expand All @@ -1214,7 +1214,7 @@ should not be used unless you are certain of correctness.
* `value` {Number} Bytes to be written to Buffer
* `offset` {Number} `0 <= offset <= buf.length - 1`
* `noAssert` {Boolean} Default: false
* Return: {Number} Numbers of bytes written
* Return: {Number} The offset plus the number of written bytes

Writes `value` to the Buffer at the specified `offset`. The `value` must be a
valid unsigned 8-bit integer.
Expand Down Expand Up @@ -1243,7 +1243,7 @@ console.log(buf);
* `value` {Number} Bytes to be written to Buffer
* `offset` {Number} `0 <= offset <= buf.length - 2`
* `noAssert` {Boolean} Default: false
* Return: {Number} Numbers of bytes written
* Return: {Number} The offset plus the number of written bytes

Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeUInt16BE()` writes big endian, `writeUInt16LE()` writes little
Expand Down Expand Up @@ -1277,7 +1277,7 @@ console.log(buf);
* `value` {Number} Bytes to be written to Buffer
* `offset` {Number} `0 <= offset <= buf.length - 4`
* `noAssert` {Boolean} Default: false
* Return: {Number} Numbers of bytes written
* Return: {Number} The offset plus the number of written bytes

Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeUInt32BE()` writes big endian, `writeUInt32LE()` writes little
Expand Down Expand Up @@ -1310,7 +1310,7 @@ console.log(buf);
* `offset` {Number} `0 <= offset <= buf.length - byteLength`
* `byteLength` {Number} `0 < byteLength <= 6`
* `noAssert` {Boolean} Default: false
* Return: {Number} Numbers of bytes written
* Return: {Number} The offset plus the number of written bytes

Writes `value` to the Buffer at the specified `offset` and `byteLength`.
Supports up to 48 bits of accuracy. For example:
Expand Down