@@ -1279,9 +1279,10 @@ changes:
1279
1279
1280
1280
* ` value ` {string|Buffer|Uint8Array|integer} What to search for.
1281
1281
* ` byteOffset ` {integer} Where to begin searching in ` buf ` . ** Default:** ` 0 ` .
1282
- * ` encoding ` {string} The encoding of ` value ` if ` value ` is a string.
1283
- ** Default:** ` 'utf8' ` .
1284
- * Returns: {integer} The index of the first occurrence of ` value ` in ` buf ` or
1282
+ * ` encoding ` {string} If ` value ` is a string, this is the encoding used to
1283
+ determine the binary representation of the string that will be searched for in
1284
+ ` buf ` . ** Default:** ` 'utf8' ` .
1285
+ * Returns: {integer} The index of the first occurrence of ` value ` in ` buf ` , or
1285
1286
` -1 ` if ` buf ` does not contain ` value ` .
1286
1287
1287
1288
If ` value ` is:
@@ -1381,13 +1382,14 @@ changes:
1381
1382
* ` value ` {string|Buffer|Uint8Array|integer} What to search for.
1382
1383
* ` byteOffset ` {integer} Where to begin searching in ` buf ` .
1383
1384
** Default:** [ ` buf.length ` ] ` - 1 ` .
1384
- * ` encoding ` {string} If ` value ` is a string, this is its encoding.
1385
- ** Default:** ` 'utf8' ` .
1386
- * Returns: {integer} The index of the last occurrence of ` value ` in ` buf ` or ` -1 `
1387
- if ` buf ` does not contain ` value ` .
1385
+ * ` encoding ` {string} If ` value ` is a string, this is the encoding used to
1386
+ determine the binary representation of the string that will be searched for in
1387
+ ` buf ` . ** Default:** ` 'utf8' ` .
1388
+ * Returns: {integer} The index of the last occurrence of ` value ` in ` buf ` , or
1389
+ ` -1 ` if ` buf ` does not contain ` value ` .
1388
1390
1389
- Identical to [ ` buf.indexOf() ` ] , except ` buf ` is searched from back to front
1390
- instead of front to back .
1391
+ Identical to [ ` buf.indexOf() ` ] , except the last occurrence of ` value ` is found
1392
+ rather than the first occurrence .
1391
1393
1392
1394
``` js
1393
1395
const buf = Buffer .from (' this buffer is a buffer' );
0 commit comments