Skip to content

Commit 87fd996

Browse files
targosrvagg
authored andcommitted
doc: clarify optional arguments of Buffer methods
PR-URL: #5008 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
1 parent 9908ece commit 87fd996

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/api/buffer.markdown

+4-4
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ console.log(buf2.compare(buf3));
388388
// produces sort order [buf1, buf3, buf2]
389389
```
390390

391-
### buf.copy(targetBuffer[, targetStart][, sourceStart][, sourceEnd])
391+
### buf.copy(targetBuffer[, targetStart[, sourceStart[, sourceEnd]]])
392392

393393
* `targetBuffer` {Buffer} Buffer to copy into
394394
* `targetStart` {Number} Default: 0
@@ -471,7 +471,7 @@ console.log(buf1.equals(buf3));
471471
// Prints: false
472472
```
473473

474-
### buf.fill(value[, offset][, end])
474+
### buf.fill(value[, offset[, end]])
475475

476476
* `value` {String or Number}
477477
* `offset` {Number} Default: 0
@@ -915,7 +915,7 @@ buf.slice(-5, -2).toString();
915915
// Returns 'uff', equivalent to buf.slice(1, 4)
916916
```
917917

918-
### buf.toString([encoding][, start][, end])
918+
### buf.toString([encoding[, start[, end]]])
919919

920920
* `encoding` {String} Default: `'utf8'`
921921
* `start` {Number} Default: 0
@@ -998,7 +998,7 @@ for (var value of buf) {
998998
// 114
999999
```
10001000

1001-
### buf.write(string[, offset][, length][, encoding])
1001+
### buf.write(string[, offset[, length]][, encoding])
10021002

10031003
* `string` {String} Bytes to be written to buffer
10041004
* `offset` {Number} Default: 0

0 commit comments

Comments
 (0)