Skip to content

Commit

Permalink
doc: consistent 'Returns:'
Browse files Browse the repository at this point in the history
For consistency, changed all `Return:` to `Returns:` in the API docs.

PR-URL: #9554
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
  • Loading branch information
silverwind authored and MylesBorins committed Dec 21, 2016
1 parent c87ccfa commit d33520c
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 72 deletions.
84 changes: 42 additions & 42 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ added: v0.1.90
calculate the length of
* `encoding` {String} If `string` is a string, this is its encoding.
**Default:** `'utf8'`
* Return: {Integer} The number of bytes contained within `string`
* Returns: {Integer} The number of bytes contained within `string`

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

* `buf1` {Buffer}
* `buf2` {Buffer}
* Return: {Integer}
* Returns: {Integer}

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

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

* `obj` {Object}
* Return: {Boolean}
* Returns: {Boolean}

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

Expand All @@ -841,7 +841,7 @@ added: v0.9.1
-->

* `encoding` {String} A character encoding name to check
* Return: {Boolean}
* Returns: {Boolean}

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

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

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

* Return: {Iterator}
* Returns: {Iterator}

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

* `otherBuffer` {Buffer} A `Buffer` to compare to
* Return: {Boolean}
* Returns: {Boolean}

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

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

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

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

Expand Down Expand Up @@ -1198,7 +1198,7 @@ console.log(buf.includes('this', 4));
added: v1.1.0
-->

* Return: {Iterator}
* Returns: {Iterator}

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

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

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

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

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

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

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

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

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

Expand Down Expand Up @@ -1428,7 +1428,7 @@ added: v0.5.5

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

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

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

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

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

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

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

Expand Down Expand Up @@ -1558,7 +1558,7 @@ added: v0.5.5

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

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

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

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

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

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

* Return: {Buffer} A reference to `buf`
* Returns: {Buffer} A reference to `buf`

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

* Return: {Buffer} A reference to `buf`
* Returns: {Buffer} A reference to `buf`

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

* Return: {Buffer} A reference to `buf`
* Returns: {Buffer} A reference to `buf`

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

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

* Return: {Object}
* Returns: {Object}

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

* Return: {Iterator}
* Returns: {Iterator}

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

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

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

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

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

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

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

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

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

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

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

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

0 comments on commit d33520c

Please sign in to comment.