@@ -115,7 +115,7 @@ console.log(buf2);
115
115
Note that when creating a Buffer using the TypeArray's ` .buffer ` , it is not
116
116
currently possible to use only a portion of the underlying ` ArrayBuffer ` . To
117
117
create a Buffer that uses only a part of the ` ArrayBuffer ` , use the
118
- ` buf.slice() ` function after the Buffer is created:
118
+ [ ` buf.slice() ` ] [ ] function after the Buffer is created:
119
119
120
120
``` js
121
121
const arr = new Uint16Array (20 );
@@ -140,8 +140,8 @@ for (var b of buf)
140
140
// 3
141
141
```
142
142
143
- Additionally, the ` buffer .values()` , ` buffer .keys()` , and ` buffer.entries() `
144
- methods can be used to create iterators.
143
+ Additionally, the [ ` buf .values()` ] [ ] , [ ` buf .keys()` ] [ ] , and
144
+ [ ` buf.entries() ` ] [ ] methods can be used to create iterators.
145
145
146
146
## Class: Buffer
147
147
@@ -276,7 +276,7 @@ console.log(`${str}: ${str.length} characters, ` +
276
276
* Return: {Number}
277
277
278
278
Compares ` buf1 ` to ` buf2 ` typically for the purpose of sorting arrays of
279
- Buffers. This is equivalent is calling ` buf1.compare(buf2) ` .
279
+ Buffers. This is equivalent is calling [ ` buf1.compare(buf2) ` ] [ ] .
280
280
281
281
``` js
282
282
const arr = [Buffer (' 1234' ), Buffer (' 0123' )];
@@ -499,7 +499,7 @@ Operates similar to [`Array#indexOf()`][] in that it returns either the
499
499
starting index position of ` value ` in Buffer or ` -1 ` if the Buffer does not
500
500
contain ` value ` . The ` value ` can be a String, Buffer or Number. Strings are by
501
501
default interpreted as UTF8. Buffers will use the entire Buffer (to compare a
502
- partial Buffer use [ ` Buffer# slice()` ] [ ] ). Numbers can range from 0 to 255.
502
+ partial Buffer use [ ` buf. slice()` ] [ ] ). Numbers can range from 0 to 255.
503
503
504
504
``` js
505
505
const buf = new Buffer (' this is a buffer' );
@@ -532,9 +532,10 @@ utf16Buffer.indexOf('\u03a3', -4, 'ucs2');
532
532
* ` encoding ` {String} Default: ` 'utf8' `
533
533
* Return: {Boolean}
534
534
535
- Operates similar to [ Array#includes()] [ ] . The ` value ` can be a String, Buffer
535
+ Operates similar to [ ` Array#includes() ` ] [ ] . The ` value ` can be a String, Buffer
536
536
or Number. Strings are interpreted as UTF8 unless overridden with the
537
- ` encoding ` argument. Buffers will use the entire Buffer (to compare a partial Buffer use ` Buffer#slice() ` ). Numbers can range from 0 to 255.
537
+ ` encoding ` argument. Buffers will use the entire Buffer (to compare a partial
538
+ Buffer use [ ` buf.slice() ` ] [ ] ). Numbers can range from 0 to 255.
538
539
539
540
The ` byteOffset ` indicates the index in ` buf ` where searching begins.
540
541
@@ -600,7 +601,7 @@ console.log(buf.length);
600
601
While the ` length ` property is not immutable, changing the value of ` length `
601
602
can result in undefined and inconsistent behavior. Applications that wish to
602
603
modify the length of a Buffer should therefore treat ` length ` as read-only and
603
- use [ ` buf.slice ` ] [ ] to create a new Buffer.
604
+ use [ ` buf.slice() ` ] [ ] to create a new Buffer.
604
605
605
606
``` js
606
607
const buf = new Buffer (10 );
@@ -943,7 +944,7 @@ buf.toString(undefined,0,5);
943
944
944
945
* Return: {Object}
945
946
946
- Returns a JSON representation of the Buffer instance. ` JSON.stringify `
947
+ Returns a JSON representation of the Buffer instance. [ ` JSON.stringify() ` ] [ ]
947
948
implicitly calls this function when stringifying a Buffer instance.
948
949
949
950
Example:
@@ -1352,11 +1353,15 @@ has observed undue memory retention in their applications.
1352
1353
1353
1354
[ iterator ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols
1354
1355
[ `Array#indexOf()` ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
1355
- [ Array#includes() ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
1356
+ [ ` Array#includes()` ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
1356
1357
[ `buf.fill(0)` ] : #buffer_buf_fill_value_offset_end
1357
- [ `buf.slice` ] : #buffer_buf_slice_start_end
1358
+ [ `buf.slice() ` ] : #buffer_buf_slice_start_end
1358
1359
[ `buf1.compare(buf2)` ] : #buffer_buf_compare_otherbuffer
1359
1360
[ `Buffer#slice()` ] : #buffer_buf_slice_start_end
1360
1361
[ `RangeError` ] : errors.html#errors_class_rangeerror
1361
1362
[ `String.prototype.length` ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length
1362
1363
[ `util.inspect()` ] : util.html#util_util_inspect_object_options
1364
+ [ `buf.values()` ] : #buffer_buf_values
1365
+ [ `buf.keys()` ] : #buffer_buf_keys
1366
+ [ `buf.entries()` ] : #buffer_buf_entries
1367
+ [ `JSON.stringify()` ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
0 commit comments