Skip to content

Commit

Permalink
doc: clarify optional arguments of Buffer methods
Browse files Browse the repository at this point in the history
PR-URL: #5008
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
  • Loading branch information
targos authored and rvagg committed Feb 8, 2016
1 parent 9908ece commit 87fd996
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/api/buffer.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ console.log(buf2.compare(buf3));
// produces sort order [buf1, buf3, buf2]
```

### buf.copy(targetBuffer[, targetStart][, sourceStart][, sourceEnd])
### buf.copy(targetBuffer[, targetStart[, sourceStart[, sourceEnd]]])

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

### buf.fill(value[, offset][, end])
### buf.fill(value[, offset[, end]])

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

### buf.toString([encoding][, start][, end])
### buf.toString([encoding[, start[, end]]])

* `encoding` {String} Default: `'utf8'`
* `start` {Number} Default: 0
Expand Down Expand Up @@ -998,7 +998,7 @@ for (var value of buf) {
// 114
```

### buf.write(string[, offset][, length][, encoding])
### buf.write(string[, offset[, length]][, encoding])

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

0 comments on commit 87fd996

Please sign in to comment.