Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: clarify optional arguments of Buffer methods #5008

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
doc: clarify optional arguments of Buffer methods
targos committed Jan 31, 2016
commit f9a5bd08a58876d4b892eb8261825fd4a400da24
8 changes: 4 additions & 4 deletions doc/api/buffer.markdown
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -914,7 +914,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
@@ -997,7 +997,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