Skip to content

Commit

Permalink
doc: add notes about negative offsets in buffer.md
Browse files Browse the repository at this point in the history
PR-URL: #27030
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Signed-off-by: Beth Griggs <[email protected]>
  • Loading branch information
vsemozhetbyt authored and BethGriggs committed Apr 9, 2019
1 parent 3567ff1 commit 5983cef
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,8 @@ added: v5.3.0
-->

* `value` {string|Buffer|Uint8Array|integer} What to search for.
* `byteOffset` {integer} Where to begin searching in `buf`. **Default:** `0`.
* `byteOffset` {integer} Where to begin searching in `buf`. If negative, then
offset is calculated from the end of `buf`. **Default:** `0`.
* `encoding` {string} If `value` is a string, this is its encoding.
**Default:** `'utf8'`.
* Returns: {boolean} `true` if `value` was found in `buf`, `false` otherwise.
Expand Down Expand Up @@ -1321,7 +1322,8 @@ changes:
-->

* `value` {string|Buffer|Uint8Array|integer} What to search for.
* `byteOffset` {integer} Where to begin searching in `buf`. **Default:** `0`.
* `byteOffset` {integer} Where to begin searching in `buf`. If negative, then
offset is calculated from the end of `buf`. **Default:** `0`.
* `encoding` {string} If `value` is a string, this is the encoding used to
determine the binary representation of the string that will be searched for in
`buf`. **Default:** `'utf8'`.
Expand Down Expand Up @@ -1423,8 +1425,9 @@ changes:
-->

* `value` {string|Buffer|Uint8Array|integer} What to search for.
* `byteOffset` {integer} Where to begin searching in `buf`.
**Default:** [`buf.length`]` - 1`.
* `byteOffset` {integer} Where to begin searching in `buf`. If negative, then
offset is calculated from the end of `buf`. **Default:**
[`buf.length`]` - 1`.
* `encoding` {string} If `value` is a string, this is the encoding used to
determine the binary representation of the string that will be searched for in
`buf`. **Default:** `'utf8'`.
Expand Down

0 comments on commit 5983cef

Please sign in to comment.