-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
doc: document undocumented methods on buffer prototype #48041
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
Changes from 1 commit
3e2bb60
a2526d0
85c958f
69433b7
2eca8b0
3145d10
737bc2e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3518,14 +3518,14 @@ console.log(buf.toString()); | |||||
| ### `buf.asciiSlice([start[, end]])` | ||||||
|
|
||||||
| * `start` {integer} The byte offset to start slicing at. **Default**: 0. | ||||||
| * `end` {integer} The byte offset to stop slicing at (not inclusive). | ||||||
| * `end` {integer} The byte offset to stop slicing at (not inclusive). | ||||||
| **Default**: `buf.length`. | ||||||
| * Returns: {string} | ||||||
|
|
||||||
| Decodes buf to a string according ASCII character encoding. `start` and | ||||||
| Decodes buf to a string according ASCII character encoding. `start` and | ||||||
| `end` may be passed to decode only a subset of `buf`. | ||||||
|
|
||||||
| In most cases, `buf.toString()` is preferable, especially if encoding is | ||||||
| In most cases, `buf.toString()` is preferable, especially if encoding is | ||||||
| variable. | ||||||
|
|
||||||
| ```mjs | ||||||
|
|
@@ -3549,11 +3549,11 @@ console.log(buf.asciiSlice(0, 3)); | |||||
| ### `buf.base64Slice([start[, end]])` | ||||||
|
|
||||||
| * `start` {integer} The byte offset to start slicing at. **Default**: 0. | ||||||
| * `end` {integer} The byte offset to stop decoding at (not inclusive). | ||||||
| * `end` {integer} The byte offset to stop decoding at (not inclusive). | ||||||
| **Default**: `buf.length`. | ||||||
| * Returns: {string} | ||||||
|
|
||||||
| Decodes buf to a string according to base64 character encoding. `start` and | ||||||
| Decodes buf to a string according to base64 character encoding. `start` and | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| `end` may be passed to decode only a subset of `buf`. | ||||||
|
|
||||||
| ```mjs | ||||||
|
|
@@ -3577,11 +3577,11 @@ console.log(buf.base64Slice(0, 3)); | |||||
| ### `buf.base64urlSlice([start[, end]])` | ||||||
|
|
||||||
| * `start` {integer} The byte offset to start slicing at. **Default**: 0. | ||||||
| * `end` {integer} The byte offset to stop decoding at (not inclusive). | ||||||
| * `end` {integer} The byte offset to stop decoding at (not inclusive). | ||||||
| **Default**: `buf.length`. | ||||||
| * Returns: {string} | ||||||
|
|
||||||
| Decodes buf to a string according to base64url character encoding. `start` | ||||||
| Decodes buf to a string according to base64url character encoding. `start` | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| and `end` may be passed to decode only a subset of `buf`. | ||||||
|
|
||||||
| ```mjs | ||||||
|
|
@@ -3605,11 +3605,11 @@ console.log(buf.base64urlSlice(0, 3)); | |||||
| ### `buf.hexSlice([start[, end]])` | ||||||
|
|
||||||
| * `start` {integer} The byte offset to start slicing at. **Default**: 0. | ||||||
| * `end` {integer} The byte offset to stop decoding at (not inclusive). | ||||||
| * `end` {integer} The byte offset to stop decoding at (not inclusive). | ||||||
| **Default**: `buf.length`. | ||||||
| * Returns: {string} | ||||||
|
|
||||||
| Decodes buf to a string according to hex character encoding. `start` and | ||||||
| Decodes buf to a string according to hex character encoding. `start` and | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| `end` may be passed to decode only a subset of `buf`. | ||||||
|
|
||||||
| ```mjs | ||||||
|
|
@@ -3633,11 +3633,11 @@ console.log(buf.hexSlice(0, 3)); | |||||
| ### `buf.latin1Slice([start[, end]])` | ||||||
|
|
||||||
| * `start` {integer} The byte offset to start slicing at. **Default**: 0. | ||||||
| * `end` {integer} The byte offset to stop slicing at (not inclusive). | ||||||
| * `end` {integer} The byte offset to stop slicing at (not inclusive). | ||||||
| **Default**: `buf.length`. | ||||||
| * Returns: {string} | ||||||
|
|
||||||
| Decodes buf to a string according to latin1 character encoding. `start` and | ||||||
| Decodes buf to a string according to latin1 character encoding. `start` and | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| `end` may be passed to decode only a subset of `buf`. | ||||||
|
|
||||||
| ```mjs | ||||||
|
|
@@ -3661,11 +3661,11 @@ console.log(buf.latin1Slice(0, 3)); | |||||
| ### `buf.ucs2Slice([start[, end]])` | ||||||
|
|
||||||
| * `start` {integer} The byte offset to start slicing at. **Default**: 0. | ||||||
| * `end` {integer} The byte offset to stop slicing at (not inclusive). | ||||||
| * `end` {integer} The byte offset to stop slicing at (not inclusive). | ||||||
| **Default**: `buf.length`. | ||||||
| * Returns: {string} | ||||||
|
|
||||||
| Decodes buf to a string according to UCS-2 character encoding. `start` and | ||||||
| Decodes buf to a string according to UCS-2 character encoding. `start` and | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| `end` may be passed to decode only a subset of `buf`. | ||||||
|
|
||||||
| ```mjs | ||||||
|
|
@@ -3689,11 +3689,11 @@ console.log(buf.ucs2Slice(0, 3)); | |||||
| ### `buf.utf8Slice([start[, end]])` | ||||||
|
|
||||||
| * `start` {integer} The byte offset to start slicing at. **Default**: 0. | ||||||
| * `end` {integer} The byte offset to stop slicing at (not inclusive). | ||||||
| * `end` {integer} The byte offset to stop slicing at (not inclusive). | ||||||
| **Default**: `buf.length`. | ||||||
| * Returns: {string} | ||||||
|
|
||||||
| Decodes buf to a string according to UTF-8 character encoding. `start` and | ||||||
| Decodes buf to a string according to UTF-8 character encoding. `start` and | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| `end` may be passed to decode only a subset of `buf`. | ||||||
|
|
||||||
| ```mjs | ||||||
|
|
@@ -3717,7 +3717,7 @@ console.log(buf.utf8Slice(0, 3)); | |||||
| ### `buf.asciiWrite(string[, offset[, length]])` | ||||||
|
|
||||||
| * `string` {string} String to write to `buf`. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the string needs to be ASCII? Or what happens if it contains non-ASCII chars? |
||||||
| * `offset` {integer} Number of bytes to skip before starting to write | ||||||
| * `offset` {integer} Number of bytes to skip before starting to write | ||||||
| `string`. **Default**: 0. | ||||||
| * `length` {integer} Maximum number of bytes to write. **Default**: `buf. | ||||||
| length - offset`. | ||||||
|
|
@@ -3749,7 +3749,7 @@ console.log(bytesWritten); | |||||
| ### `buf.base64Write(string[, offset[, length]])` | ||||||
|
|
||||||
| * `string` {string} String to write to `buf`. | ||||||
| * `offset` {integer} Number of bytes to skip before starting to write | ||||||
| * `offset` {integer} Number of bytes to skip before starting to write | ||||||
| `string`. **Default**: 0. | ||||||
| * `length` {integer} Maximum number of bytes to write. **Default**: `buf. | ||||||
| length - offset`. | ||||||
|
|
@@ -3815,7 +3815,7 @@ console.log(bytesWritten); | |||||
| ### `buf.hexWrite(string[, offset[, length]])` | ||||||
|
|
||||||
| * `string` {string} String to write to `buf`. | ||||||
| * `offset` {integer} Number of bytes to skip before starting to write | ||||||
| * `offset` {integer} Number of bytes to skip before starting to write | ||||||
| `string`. **Default**: 0. | ||||||
| * `length` {integer} Maximum number of bytes to write. **Default**: `buf. | ||||||
| length - offset`. | ||||||
|
|
@@ -3849,7 +3849,7 @@ console.log(bytesWritten); | |||||
| ### `buf.latin1Write(string[, offset[, length]])` | ||||||
|
|
||||||
| * `string` {string} String to write to `buf`. | ||||||
| * `offset` {integer} Number of bytes to skip before starting to write | ||||||
| * `offset` {integer} Number of bytes to skip before starting to write | ||||||
| `string`. **Default**: 0. | ||||||
| * `length` {integer} Maximum number of bytes to write. **Default**: `buf. | ||||||
| length - offset`. | ||||||
|
|
@@ -3883,7 +3883,7 @@ console.log(bytesWritten); | |||||
| ### `buf.utf8Write(string[, offset[, length]])` | ||||||
|
|
||||||
| * `string` {string} String to write to `buf`. | ||||||
| * `offset` {integer} Number of bytes to skip before starting to write | ||||||
| * `offset` {integer} Number of bytes to skip before starting to write | ||||||
| `string`. **Default**: 0. | ||||||
| * `length` {integer} Maximum number of bytes to write. **Default**: `buf. | ||||||
| length - offset`. | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.