chore(docs): Generated References (#5602)
Generated the following references: - `pricing` - `product` Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
2110 files changed
+148777
-4448445
No files matched your search
@@ -21,6 +21,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "number",
|
||||
@@ -28,6 +29,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
|
||||
@@ -23,6 +23,7 @@ Negative integers count back from the last item in the array.
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -38,6 +39,7 @@ Negative integers count back from the last item in the array.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -18,7 +18,7 @@ Comparison is based on the actual sequence of bytes in each `Buffer`.
|
||||
* `-1` is returned if `target` should come _after_`buf` when sorted.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf1 = Buffer.from('ABC');
|
||||
const buf2 = Buffer.from('BCD');
|
||||
@@ -42,7 +42,7 @@ console.log([buf1, buf2, buf3].sort(Buffer.compare));
|
||||
The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
||||
const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
|
||||
@@ -66,6 +66,7 @@ console.log(buf1.compare(buf2, 5, 6, 5));
|
||||
"description": "A `Buffer` or Uint8Array with which to compare `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -74,6 +75,7 @@ console.log(buf1.compare(buf2, 5, 6, 5));
|
||||
"description": "The offset within `target` at which to begin comparison.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -82,6 +84,7 @@ console.log(buf1.compare(buf2, 5, 6, 5));
|
||||
"description": "The offset within `target` at which to end comparison (not inclusive).",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -90,6 +93,7 @@ console.log(buf1.compare(buf2, 5, 6, 5));
|
||||
"description": "The offset within `buf` at which to begin comparison.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -98,6 +102,7 @@ console.log(buf1.compare(buf2, 5, 6, 5));
|
||||
"description": "The offset within `buf` at which to end comparison (not inclusive).",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -113,6 +118,7 @@ console.log(buf1.compare(buf2, 5, 6, 5));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -17,7 +17,7 @@ for all TypedArrays, including Node.js `Buffer`s, although it takes
|
||||
different function arguments.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
// Create two `Buffer` instances.
|
||||
const buf1 = Buffer.allocUnsafe(26);
|
||||
@@ -38,7 +38,7 @@ console.log(buf2.toString('ascii', 0, 25));
|
||||
```
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
// Create a `Buffer` and copy data from one region to an overlapping region
|
||||
// within the same `Buffer`.
|
||||
@@ -65,6 +65,7 @@ console.log(buf.toString());
|
||||
"description": "A `Buffer` or Uint8Array to copy into.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -73,6 +74,7 @@ console.log(buf.toString());
|
||||
"description": "The offset within `target` at which to begin writing.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -81,6 +83,7 @@ console.log(buf.toString());
|
||||
"description": "The offset within `buf` from which to begin copying.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -89,6 +92,7 @@ console.log(buf.toString());
|
||||
"description": "The offset within `buf` at which to stop copying (not inclusive).",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -104,6 +108,7 @@ console.log(buf.toString());
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "The number of bytes copied.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -22,6 +22,7 @@ to the same array starting at position target
|
||||
"description": "If target is negative, it is treated as length+target where length is the length of the array.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -30,6 +31,7 @@ to the same array starting at position target
|
||||
"description": "If start is negative, it is treated as length+start. If end is negative, it is treated as length+end.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -38,6 +40,7 @@ to the same array starting at position target
|
||||
"description": "If not specified, length of the this object is used as its default value.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -53,6 +56,7 @@ to the same array starting at position target
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/J
|
||||
of `buf`.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
// Log the entire contents of a `Buffer`.
|
||||
|
||||
@@ -43,6 +43,7 @@ for (const pair of buf.entries()) {
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "number",
|
||||
@@ -50,6 +51,7 @@ for (const pair of buf.entries()) {
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -58,6 +60,7 @@ for (const pair of buf.entries()) {
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
|
||||
@@ -13,7 +13,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf1 = Buffer.from('ABC');
|
||||
const buf2 = Buffer.from('414243', 'hex');
|
||||
@@ -34,6 +34,7 @@ console.log(buf1.equals(buf3));
|
||||
"description": "A `Buffer` or Uint8Array with which to compare `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -49,6 +50,7 @@ console.log(buf1.equals(buf3));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -21,7 +21,18 @@ Determines whether all the members of an array satisfy the specified test.
|
||||
"description": "A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `unknown`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "thisArg",
|
||||
@@ -29,6 +40,7 @@ Determines whether all the members of an array satisfy the specified test.
|
||||
"description": "An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -44,6 +56,7 @@ Determines whether all the members of an array satisfy the specified test.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Fills `buf` with the specified `value`. If the `offset` and `end` are not given,
|
||||
the entire `buf` will be filled:
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
// Fill a `Buffer` with the ASCII character 'h'.
|
||||
|
||||
@@ -22,6 +22,12 @@ const b = Buffer.allocUnsafe(50).fill('h');
|
||||
|
||||
console.log(b.toString());
|
||||
// Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
|
||||
|
||||
// Fill a buffer with empty string
|
||||
const c = Buffer.allocUnsafe(5).fill('');
|
||||
|
||||
console.log(c.fill(''));
|
||||
// Prints: <Buffer 00 00 00 00 00>
|
||||
```
|
||||
|
||||
`value` is coerced to a `uint32` value if it is not a string, `Buffer`, or
|
||||
@@ -32,7 +38,7 @@ If the final write of a `fill()` operation falls on a multi-byte character,
|
||||
then only the bytes of that character that fit into `buf` are written:
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
// Fill a `Buffer` with character that takes up two bytes in UTF-8.
|
||||
|
||||
@@ -44,7 +50,7 @@ If `value` contains invalid characters, it is truncated; if no valid
|
||||
fill data remains, an exception is thrown:
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(5);
|
||||
|
||||
@@ -62,9 +68,10 @@ console.log(buf.fill('zz', 'hex'));
|
||||
{
|
||||
"name": "value",
|
||||
"type": "`string` \\| `number` \\| `Uint8Array`",
|
||||
"description": "The value with which to fill `buf`.",
|
||||
"description": "The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -73,6 +80,7 @@ console.log(buf.fill('zz', 'hex'));
|
||||
"description": "Number of bytes to skip before starting to fill `buf`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -81,6 +89,7 @@ console.log(buf.fill('zz', 'hex'));
|
||||
"description": "Where to stop filling `buf` (not inclusive).",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -89,6 +98,7 @@ console.log(buf.fill('zz', 'hex'));
|
||||
"description": "The encoding for `value` if `value` is a string.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -104,6 +114,7 @@ console.log(buf.fill('zz', 'hex'));
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "A reference to `buf`.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -21,7 +21,18 @@ Returns the elements of an array that meet the condition specified in a callback
|
||||
"description": "A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `any`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "thisArg",
|
||||
@@ -29,6 +40,7 @@ Returns the elements of an array that meet the condition specified in a callback
|
||||
"description": "An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -44,6 +56,7 @@ Returns the elements of an array that meet the condition specified in a callback
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -22,7 +22,18 @@ otherwise.
|
||||
"description": "find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`value`: `number`, `index`: `number`, `obj`: `Uint8Array`) => `boolean`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "thisArg",
|
||||
@@ -30,6 +41,7 @@ otherwise.
|
||||
"description": "If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -45,6 +57,7 @@ otherwise.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -22,7 +22,18 @@ otherwise.
|
||||
"description": "find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`value`: `number`, `index`: `number`, `obj`: `Uint8Array`) => `boolean`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "thisArg",
|
||||
@@ -30,6 +41,7 @@ otherwise.
|
||||
"description": "If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -45,6 +57,7 @@ otherwise.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -21,7 +21,18 @@ Performs the specified action for each element in an array.
|
||||
"description": "A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `void`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "thisArg",
|
||||
@@ -29,6 +40,7 @@ Performs the specified action for each element in an array.
|
||||
"description": "An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -44,6 +56,7 @@ Performs the specified action for each element in an array.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -13,7 +13,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
Equivalent to `buf.indexOf() !== -1`.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from('this is a buffer');
|
||||
|
||||
@@ -42,6 +42,7 @@ console.log(buf.includes('this', 4));
|
||||
"description": "What to search for.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -50,6 +51,7 @@ console.log(buf.includes('this', 4));
|
||||
"description": "Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -58,6 +60,7 @@ console.log(buf.includes('this', 4));
|
||||
"description": "If `value` is a string, this is its encoding.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -73,6 +76,7 @@ console.log(buf.includes('this', 4));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`true` if `value` was found in `buf`, `false` otherwise.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,7 +19,7 @@ To compare a partial `Buffer`, use `buf.subarray`.
|
||||
value between `0` and `255`.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from('this is a buffer');
|
||||
|
||||
@@ -52,7 +52,7 @@ of coercion is `NaN` or `0`, then the entire buffer will be searched. This
|
||||
behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const b = Buffer.from('abcdef');
|
||||
|
||||
@@ -81,6 +81,7 @@ than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOf
|
||||
"description": "What to search for.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -89,6 +90,7 @@ than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOf
|
||||
"description": "Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -97,6 +99,7 @@ than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOf
|
||||
"description": "If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -112,6 +115,7 @@ than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOf
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -21,6 +21,7 @@ Adds all the elements of an array separated by the specified separator string.
|
||||
"description": "A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -36,6 +37,7 @@ Adds all the elements of an array separated by the specified separator string.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -13,7 +13,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices).
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from('buffer');
|
||||
|
||||
@@ -40,6 +40,7 @@ for (const key of buf.keys()) {
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "number",
|
||||
@@ -47,6 +48,7 @@ for (const key of buf.keys()) {
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
|
||||
@@ -14,7 +14,7 @@ Identical to `buf.indexOf()`, except the last occurrence of `value` is found
|
||||
rather than the first occurrence.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from('this buffer is a buffer');
|
||||
|
||||
@@ -49,7 +49,7 @@ that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer.
|
||||
This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf).
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const b = Buffer.from('abcdef');
|
||||
|
||||
@@ -80,6 +80,7 @@ If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned.
|
||||
"description": "What to search for.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -88,6 +89,7 @@ If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned.
|
||||
"description": "Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -96,6 +98,7 @@ If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned.
|
||||
"description": "If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -111,6 +114,7 @@ If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -22,7 +22,18 @@ contains the results.
|
||||
"description": "A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `number`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "thisArg",
|
||||
@@ -30,6 +41,7 @@ contains the results.
|
||||
"description": "An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -45,6 +57,7 @@ contains the results.
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -24,6 +24,7 @@ values.
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -39,6 +40,7 @@ values.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -24,6 +24,7 @@ values.
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -39,6 +40,7 @@ values.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`
|
||||
This function is also available under the `readBigUint64BE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
|
||||
|
||||
@@ -32,6 +32,7 @@ console.log(buf.readBigUInt64BE(0));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -47,6 +48,7 @@ console.log(buf.readBigUInt64BE(0));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offs
|
||||
This function is also available under the `readBigUint64LE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
|
||||
|
||||
@@ -32,6 +32,7 @@ console.log(buf.readBigUInt64LE(0));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -47,6 +48,7 @@ console.log(buf.readBigUInt64LE(0));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -34,6 +35,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -34,6 +35,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -13,7 +13,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
|
||||
|
||||
@@ -30,6 +30,7 @@ console.log(buf.readDoubleBE(0));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -45,6 +46,7 @@ console.log(buf.readDoubleBE(0));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -13,7 +13,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
Reads a 64-bit, little-endian double from `buf` at the specified `offset`.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
|
||||
|
||||
@@ -32,6 +32,7 @@ console.log(buf.readDoubleLE(1));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -47,6 +48,7 @@ console.log(buf.readDoubleLE(1));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -13,7 +13,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
Reads a 32-bit, big-endian float from `buf` at the specified `offset`.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([1, 2, 3, 4]);
|
||||
|
||||
@@ -30,6 +30,7 @@ console.log(buf.readFloatBE(0));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -45,6 +46,7 @@ console.log(buf.readFloatBE(0));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -13,7 +13,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
Reads a 32-bit, little-endian float from `buf` at the specified `offset`.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([1, 2, 3, 4]);
|
||||
|
||||
@@ -32,6 +32,7 @@ console.log(buf.readFloatLE(1));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -47,6 +48,7 @@ console.log(buf.readFloatLE(1));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`.
|
||||
Integers read from a `Buffer` are interpreted as two's complement signed values.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0, 5]);
|
||||
|
||||
@@ -32,6 +32,7 @@ console.log(buf.readInt16BE(0));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -47,6 +48,7 @@ console.log(buf.readInt16BE(0));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`
|
||||
Integers read from a `Buffer` are interpreted as two's complement signed values.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0, 5]);
|
||||
|
||||
@@ -34,6 +34,7 @@ console.log(buf.readInt16LE(1));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -49,6 +50,7 @@ console.log(buf.readInt16LE(1));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`.
|
||||
Integers read from a `Buffer` are interpreted as two's complement signed values.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0, 0, 0, 5]);
|
||||
|
||||
@@ -32,6 +32,7 @@ console.log(buf.readInt32BE(0));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -47,6 +48,7 @@ console.log(buf.readInt32BE(0));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`
|
||||
Integers read from a `Buffer` are interpreted as two's complement signed values.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0, 0, 0, 5]);
|
||||
|
||||
@@ -34,6 +34,7 @@ console.log(buf.readInt32LE(1));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -49,6 +50,7 @@ console.log(buf.readInt32LE(1));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Reads a signed 8-bit integer from `buf` at the specified `offset`.
|
||||
Integers read from a `Buffer` are interpreted as two's complement signed values.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([-1, 5]);
|
||||
|
||||
@@ -36,6 +36,7 @@ console.log(buf.readInt8(2));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -51,6 +52,7 @@ console.log(buf.readInt8(2));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Reads `byteLength` number of bytes from `buf` at the specified `offset`and inter
|
||||
supporting up to 48 bits of accuracy.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
||||
|
||||
@@ -35,6 +35,7 @@ console.log(buf.readIntBE(1, 0).toString(16));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -43,6 +44,7 @@ console.log(buf.readIntBE(1, 0).toString(16));
|
||||
"description": "Number of bytes to read. Must satisfy `0 < byteLength <= 6`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -58,6 +60,7 @@ console.log(buf.readIntBE(1, 0).toString(16));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Reads `byteLength` number of bytes from `buf` at the specified `offset`and inter
|
||||
supporting up to 48 bits of accuracy.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
||||
|
||||
@@ -31,6 +31,7 @@ console.log(buf.readIntLE(0, 6).toString(16));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -39,6 +40,7 @@ console.log(buf.readIntLE(0, 6).toString(16));
|
||||
"description": "Number of bytes to read. Must satisfy `0 < byteLength <= 6`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -54,6 +56,7 @@ console.log(buf.readIntLE(0, 6).toString(16));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`
|
||||
This function is also available under the `readUint16BE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0x12, 0x34, 0x56]);
|
||||
|
||||
@@ -34,6 +34,7 @@ console.log(buf.readUInt16BE(1).toString(16));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -49,6 +50,7 @@ console.log(buf.readUInt16BE(1).toString(16));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offs
|
||||
This function is also available under the `readUint16LE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0x12, 0x34, 0x56]);
|
||||
|
||||
@@ -36,6 +36,7 @@ console.log(buf.readUInt16LE(2).toString(16));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -51,6 +52,7 @@ console.log(buf.readUInt16LE(2).toString(16));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`
|
||||
This function is also available under the `readUint32BE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
|
||||
|
||||
@@ -32,6 +32,7 @@ console.log(buf.readUInt32BE(0).toString(16));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -47,6 +48,7 @@ console.log(buf.readUInt32BE(0).toString(16));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offs
|
||||
This function is also available under the `readUint32LE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
|
||||
|
||||
@@ -34,6 +34,7 @@ console.log(buf.readUInt32LE(1).toString(16));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -49,6 +50,7 @@ console.log(buf.readUInt32LE(1).toString(16));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
|
||||
This function is also available under the `readUint8` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([1, -2]);
|
||||
|
||||
@@ -36,6 +36,7 @@ console.log(buf.readUInt8(2));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -51,6 +52,7 @@ console.log(buf.readUInt8(2));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -16,7 +16,7 @@ up to 48 bits of accuracy.
|
||||
This function is also available under the `readUintBE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
||||
|
||||
@@ -35,6 +35,7 @@ console.log(buf.readUIntBE(1, 6).toString(16));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -43,6 +44,7 @@ console.log(buf.readUIntBE(1, 6).toString(16));
|
||||
"description": "Number of bytes to read. Must satisfy `0 < byteLength <= 6`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -58,6 +60,7 @@ console.log(buf.readUIntBE(1, 6).toString(16));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -16,7 +16,7 @@ up to 48 bits of accuracy.
|
||||
This function is also available under the `readUintLE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
||||
|
||||
@@ -33,6 +33,7 @@ console.log(buf.readUIntLE(0, 6).toString(16));
|
||||
"description": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -41,6 +42,7 @@ console.log(buf.readUIntLE(0, 6).toString(16));
|
||||
"description": "Number of bytes to read. Must satisfy `0 < byteLength <= 6`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -56,6 +58,7 @@ console.log(buf.readUIntLE(0, 6).toString(16));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -34,6 +35,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -34,6 +35,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -34,6 +35,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -34,6 +35,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -34,6 +35,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -27,6 +28,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -42,6 +44,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -27,6 +28,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -42,6 +44,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -23,7 +23,18 @@ call to the callback function.
|
||||
"description": "A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`previousValue`: `number`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `number`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -38,6 +49,7 @@ call to the callback function.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -57,7 +69,18 @@ Uint8Array.reduce
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`previousValue`: `number`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `number`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "initialValue",
|
||||
@@ -65,6 +88,7 @@ Uint8Array.reduce
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -80,6 +104,7 @@ Uint8Array.reduce
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -101,6 +126,7 @@ call to the callback function.
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -114,7 +140,18 @@ call to the callback function.
|
||||
"description": "A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`previousValue`: `U`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `U`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "initialValue",
|
||||
@@ -122,6 +159,7 @@ call to the callback function.
|
||||
"description": "If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -23,7 +23,18 @@ argument in the next call to the callback function.
|
||||
"description": "A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`previousValue`: `number`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `number`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -38,6 +49,7 @@ argument in the next call to the callback function.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -57,7 +69,18 @@ Uint8Array.reduceRight
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`previousValue`: `number`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `number`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "initialValue",
|
||||
@@ -65,6 +88,7 @@ Uint8Array.reduceRight
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -80,6 +104,7 @@ Uint8Array.reduceRight
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -101,6 +126,7 @@ argument in the next call to the callback function.
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -114,7 +140,18 @@ argument in the next call to the callback function.
|
||||
"description": "A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`previousValue`: `U`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `U`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "initialValue",
|
||||
@@ -122,6 +159,7 @@ argument in the next call to the callback function.
|
||||
"description": "If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -21,6 +21,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -21,6 +21,7 @@ Sets a value or an array of values.
|
||||
"description": "A typed or untyped array of values to set.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "length",
|
||||
@@ -28,6 +29,7 @@ Sets a value or an array of values.
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
@@ -38,6 +40,7 @@ Sets a value or an array of values.
|
||||
"description": "The index in the current array at which the values are to be written.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -53,6 +56,7 @@ Sets a value or an array of values.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -17,7 +17,7 @@ This method is not compatible with the `Uint8Array.prototype.slice()`,
|
||||
which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from('buffer');
|
||||
|
||||
@@ -47,6 +47,7 @@ console.log(buf.toString());
|
||||
"description": "Where the new `Buffer` will start.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -55,6 +56,7 @@ console.log(buf.toString());
|
||||
"description": "Where the new `Buffer` will end (not inclusive).",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -70,6 +72,7 @@ console.log(buf.toString());
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -21,7 +21,18 @@ Determines whether the specified callback function returns true for any element
|
||||
"description": "A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `unknown`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "thisArg",
|
||||
@@ -29,6 +40,7 @@ Determines whether the specified callback function returns true for any element
|
||||
"description": "An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -44,6 +56,7 @@ Determines whether the specified callback function returns true for any element
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -21,7 +21,18 @@ Sorts an array.
|
||||
"description": "Function used to determine the order of the elements. It is expected to return a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise. If omitted, the elements are sorted in ascending order. ```ts [11,2,22,1].sort((a, b) => a - b) ```",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"children": []
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "(`a`: `number`, `b`: `number`) => `number`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -36,6 +47,7 @@ Sorts an array.
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -21,7 +21,7 @@ This method is inherited from [`TypedArray.prototype.subarray()`](https://develo
|
||||
Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
// Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
|
||||
// from the original `Buffer`.
|
||||
@@ -48,7 +48,7 @@ Specifying negative indexes causes the slice to be generated relative to the
|
||||
end of `buf` rather than the beginning.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from('buffer');
|
||||
|
||||
@@ -74,6 +74,7 @@ console.log(buf.subarray(-5, -2).toString());
|
||||
"description": "Where the new `Buffer` will start.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -82,6 +83,7 @@ console.log(buf.subarray(-5, -2).toString());
|
||||
"description": "Where the new `Buffer` will end (not inclusive).",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -97,6 +99,7 @@ console.log(buf.subarray(-5, -2).toString());
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Interprets `buf` as an array of unsigned 16-bit integers and swaps the
|
||||
byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
|
||||
|
||||
@@ -36,7 +36,7 @@ One convenient use of `buf.swap16()` is to perform a fast in-place conversion
|
||||
between UTF-16 little-endian and UTF-16 big-endian:
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from('This is little-endian UTF-16', 'utf16le');
|
||||
buf.swap16(); // Convert to big-endian UTF-16 text.
|
||||
@@ -53,6 +53,7 @@ buf.swap16(); // Convert to big-endian UTF-16 text.
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "A reference to `buf`.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Interprets `buf` as an array of unsigned 32-bit integers and swaps the
|
||||
byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
|
||||
|
||||
@@ -43,6 +43,7 @@ buf2.swap32();
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "A reference to `buf`.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_.
|
||||
Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
|
||||
|
||||
@@ -43,6 +43,7 @@ buf2.swap64();
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "A reference to `buf`.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -17,7 +17,7 @@ this function when stringifying a `Buffer` instance.
|
||||
In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);
|
||||
const json = JSON.stringify(buf);
|
||||
@@ -46,6 +46,7 @@ console.log(copy);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -57,6 +58,7 @@ console.log(copy);
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -65,6 +67,7 @@ console.log(copy);
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -23,6 +23,7 @@ Converts a number to a string by using the current locale.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,7 +19,7 @@ The maximum length of a string instance (in UTF-16 code units) is available
|
||||
as constants.MAX_STRING_LENGTH.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf1 = Buffer.allocUnsafe(26);
|
||||
|
||||
@@ -52,6 +52,7 @@ console.log(buf2.toString(undefined, 0, 3));
|
||||
"description": "The character encoding to use.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -60,6 +61,7 @@ console.log(buf2.toString(undefined, 0, 3));
|
||||
"description": "The byte offset to start decoding at.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -68,6 +70,7 @@ console.log(buf2.toString(undefined, 0, 3));
|
||||
"description": "The byte offset to stop decoding at (not inclusive).",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -83,6 +86,7 @@ console.log(buf2.toString(undefined, 0, 3));
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -23,6 +23,7 @@ Returns the primitive value of the specified object.
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/J
|
||||
called automatically when a `Buffer` is used in a `for..of` statement.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.from('buffer');
|
||||
|
||||
@@ -52,6 +52,7 @@ for (const value of buf) {
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "number",
|
||||
@@ -59,6 +60,7 @@ for (const value of buf) {
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
|
||||
@@ -15,7 +15,7 @@ not contain enough space to fit the entire string, only part of `string` will be
|
||||
written. However, partially encoded characters will not be written.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.alloc(256);
|
||||
|
||||
@@ -41,6 +41,7 @@ console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);
|
||||
"description": "String to write to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -49,6 +50,7 @@ console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);
|
||||
"description": "The character encoding of `string`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -64,6 +66,7 @@ console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "Number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -83,6 +86,7 @@ v0.1.90
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -91,6 +95,7 @@ v0.1.90
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -99,6 +104,7 @@ v0.1.90
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -114,6 +120,7 @@ v0.1.90
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -129,6 +136,7 @@ v0.1.90
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -137,6 +145,7 @@ v0.1.90
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -145,6 +154,7 @@ v0.1.90
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -153,6 +163,7 @@ v0.1.90
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -168,6 +179,7 @@ v0.1.90
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -15,7 +15,7 @@ Writes `value` to `buf` at the specified `offset` as big-endian.
|
||||
`value` is interpreted and written as a two's complement signed integer.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(8);
|
||||
|
||||
@@ -34,6 +34,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -42,6 +43,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -57,6 +59,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Writes `value` to `buf` at the specified `offset` as little-endian.
|
||||
`value` is interpreted and written as a two's complement signed integer.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(8);
|
||||
|
||||
@@ -34,6 +34,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -42,6 +43,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -57,6 +59,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -15,7 +15,7 @@ Writes `value` to `buf` at the specified `offset` as big-endian.
|
||||
This function is also available under the `writeBigUint64BE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(8);
|
||||
|
||||
@@ -34,6 +34,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -42,6 +43,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -57,6 +59,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -13,7 +13,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
Writes `value` to `buf` at the specified `offset` as little-endian
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(8);
|
||||
|
||||
@@ -34,6 +34,7 @@ This function is also available under the `writeBigUint64LE` alias.
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -42,6 +43,7 @@ This function is also available under the `writeBigUint64LE` alias.
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -57,6 +59,7 @@ This function is also available under the `writeBigUint64LE` alias.
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -27,6 +28,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -42,6 +44,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -27,6 +28,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -42,6 +44,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must
|
||||
other than a JavaScript number.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(8);
|
||||
|
||||
@@ -33,6 +33,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -41,6 +42,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -56,6 +58,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Writes `value` to `buf` at the specified `offset` as little-endian. The `value`m
|
||||
other than a JavaScript number.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(8);
|
||||
|
||||
@@ -33,6 +33,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -41,6 +42,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -56,6 +58,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is
|
||||
undefined when `value` is anything other than a JavaScript number.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(4);
|
||||
|
||||
@@ -33,6 +33,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -41,6 +42,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -56,6 +58,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is
|
||||
undefined when `value` is anything other than a JavaScript number.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(4);
|
||||
|
||||
@@ -33,6 +33,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -41,6 +42,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -56,6 +58,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -16,7 +16,7 @@ anything other than a signed 16-bit integer.
|
||||
The `value` is interpreted and written as a two's complement signed integer.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(2);
|
||||
|
||||
@@ -35,6 +35,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -43,6 +44,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -58,6 +60,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -16,7 +16,7 @@ anything other than a signed 16-bit integer.
|
||||
The `value` is interpreted and written as a two's complement signed integer.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(2);
|
||||
|
||||
@@ -35,6 +35,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -43,6 +44,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -58,6 +60,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -16,7 +16,7 @@ anything other than a signed 32-bit integer.
|
||||
The `value` is interpreted and written as a two's complement signed integer.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(4);
|
||||
|
||||
@@ -35,6 +35,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -43,6 +44,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -58,6 +60,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -16,7 +16,7 @@ anything other than a signed 32-bit integer.
|
||||
The `value` is interpreted and written as a two's complement signed integer.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(4);
|
||||
|
||||
@@ -35,6 +35,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -43,6 +44,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -58,6 +60,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -17,7 +17,7 @@ a signed 8-bit integer.
|
||||
`value` is interpreted and written as a two's complement signed integer.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(2);
|
||||
|
||||
@@ -37,6 +37,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -45,6 +46,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -60,6 +62,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-en
|
||||
signed integer.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(6);
|
||||
|
||||
@@ -33,6 +33,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -41,6 +42,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -49,6 +51,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to write. Must satisfy `0 < byteLength <= 6`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -64,6 +67,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little
|
||||
when `value` is anything other than a signed integer.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(6);
|
||||
|
||||
@@ -33,6 +33,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -41,6 +42,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -49,6 +51,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to write. Must satisfy `0 < byteLength <= 6`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -64,6 +67,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -16,7 +16,7 @@ unsigned 16-bit integer.
|
||||
This function is also available under the `writeUint16BE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(4);
|
||||
|
||||
@@ -36,6 +36,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -44,6 +45,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -59,6 +61,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -16,7 +16,7 @@ anything other than an unsigned 16-bit integer.
|
||||
This function is also available under the `writeUint16LE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(4);
|
||||
|
||||
@@ -36,6 +36,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -44,6 +45,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -59,6 +61,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -16,7 +16,7 @@ unsigned 32-bit integer.
|
||||
This function is also available under the `writeUint32BE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(4);
|
||||
|
||||
@@ -35,6 +35,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -43,6 +44,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -58,6 +60,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -16,7 +16,7 @@ anything other than an unsigned 32-bit integer.
|
||||
This function is also available under the `writeUint32LE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(4);
|
||||
|
||||
@@ -35,6 +35,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -43,6 +44,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -58,6 +60,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -17,7 +17,7 @@ other than an unsigned 8-bit integer.
|
||||
This function is also available under the `writeUint8` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(4);
|
||||
|
||||
@@ -39,6 +39,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -47,6 +48,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -62,6 +64,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -16,7 +16,7 @@ when `value` is anything other than an unsigned integer.
|
||||
This function is also available under the `writeUintBE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(6);
|
||||
|
||||
@@ -35,6 +35,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -43,6 +44,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -51,6 +53,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to write. Must satisfy `0 < byteLength <= 6`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -66,6 +69,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -16,7 +16,7 @@ when `value` is anything other than an unsigned integer.
|
||||
This function is also available under the `writeUintLE` alias.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(6);
|
||||
|
||||
@@ -35,6 +35,7 @@ console.log(buf);
|
||||
"description": "Number to be written to `buf`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -43,6 +44,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -51,6 +53,7 @@ console.log(buf);
|
||||
"description": "Number of bytes to write. Must satisfy `0 < byteLength <= 6`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -66,6 +69,7 @@ console.log(buf);
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "`offset` plus the number of bytes written.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -27,6 +28,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -42,6 +44,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -27,6 +28,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -42,6 +44,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -27,6 +28,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -42,6 +44,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -27,6 +28,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -42,6 +44,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -27,6 +28,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -42,6 +44,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -27,6 +28,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -35,6 +37,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -50,6 +53,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
@@ -19,6 +19,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -27,6 +28,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -35,6 +37,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -50,6 +53,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
+9
-5
@@ -13,7 +13,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.alloc(5);
|
||||
|
||||
@@ -21,12 +21,12 @@ console.log(buf);
|
||||
// Prints: <Buffer 00 00 00 00 00>
|
||||
```
|
||||
|
||||
If `size` is larger than constants.MAX_LENGTH or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown.
|
||||
If `size` is larger than constants.MAX_LENGTH or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
|
||||
|
||||
If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.alloc(5, 'a');
|
||||
|
||||
@@ -38,7 +38,7 @@ If both `fill` and `encoding` are specified, the allocated `Buffer` will be
|
||||
initialized by calling `buf.fill(fill, encoding)`.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
|
||||
|
||||
@@ -61,14 +61,16 @@ A `TypeError` will be thrown if `size` is not a number.
|
||||
"description": "The desired length of the new `Buffer`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "fill",
|
||||
"type": "`string` \\| `number` \\| [`Buffer`](../../variables/Buffer-1.mdx)",
|
||||
"type": "`string` \\| `number` \\| `Uint8Array`",
|
||||
"description": "A value to pre-fill the new `Buffer` with.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
@@ -77,6 +79,7 @@ A `TypeError` will be thrown if `size` is not a number.
|
||||
"description": "If `fill` is a string, this is its encoding.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -92,6 +95,7 @@ A `TypeError` will be thrown if `size` is not a number.
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
+6
-5
@@ -10,13 +10,13 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
**allocUnsafe**(`size`): [`Buffer`](../../variables/Buffer-1.mdx)
|
||||
|
||||
Allocates a new `Buffer` of `size` bytes. If `size` is larger than constants.MAX_LENGTH or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown.
|
||||
Allocates a new `Buffer` of `size` bytes. If `size` is larger than constants.MAX_LENGTH or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
|
||||
|
||||
The underlying memory for `Buffer` instances created in this way is _not_
|
||||
_initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
|
||||
|
||||
```js
|
||||
import { Buffer } from 'buffer';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
const buf = Buffer.allocUnsafe(10);
|
||||
|
||||
@@ -32,9 +32,8 @@ console.log(buf);
|
||||
A `TypeError` will be thrown if `size` is not a number.
|
||||
|
||||
The `Buffer` module pre-allocates an internal `Buffer` instance of
|
||||
size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the
|
||||
deprecated`new Buffer(size)` constructor only when `size` is less than or equal
|
||||
to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
|
||||
size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`,
|
||||
and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
|
||||
|
||||
Use of this pre-allocated internal memory pool is a key difference between
|
||||
calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
|
||||
@@ -52,6 +51,7 @@ additional performance that `Buffer.allocUnsafe()` provides.
|
||||
"description": "The desired length of the new `Buffer`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -67,6 +67,7 @@ additional performance that `Buffer.allocUnsafe()` provides.
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
Loaded 100 of 2110 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user