summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2019-03-31 20:26:59 +0300
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2019-04-03 00:51:21 +0300
commit2de67343a1bcf846fcf9a6ef14e569143f0f3863 (patch)
treeefc76eeaae87f4a21e33053da5ed9903a8f1b58b /doc
parent82a95fedc8c8c2a1473d28ee2e12824cebf09cb5 (diff)
downloadandroid-node-v8-2de67343a1bcf846fcf9a6ef14e569143f0f3863.tar.gz
android-node-v8-2de67343a1bcf846fcf9a6ef14e569143f0f3863.tar.bz2
android-node-v8-2de67343a1bcf846fcf9a6ef14e569143f0f3863.zip
doc: add notes about negative offsets in buffer.md
PR-URL: https://github.com/nodejs/node/pull/27030 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/buffer.md11
1 files changed, 7 insertions, 4 deletions
diff --git a/doc/api/buffer.md b/doc/api/buffer.md
index 4200557a20..6ea304128d 100644
--- a/doc/api/buffer.md
+++ b/doc/api/buffer.md
@@ -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.
@@ -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'`.
@@ -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'`.