ordered-binary 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +0 -2
- package/index.d.ts +4 -0
- package/index.js +0 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20,8 +20,6 @@ control character types:
|
|
|
20
20
|
|
|
21
21
|
const float64Array = new Float64Array(2);
|
|
22
22
|
const int32Array = new Int32Array(float64Array.buffer, 0, 4);
|
|
23
|
-
new Uint8Array(float64Array.buffer, 2, 6);
|
|
24
|
-
new Uint8Array(float64Array.buffer, 0, 8);
|
|
25
23
|
let nullTerminate = false;
|
|
26
24
|
let textEncoder;
|
|
27
25
|
try {
|
package/index.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ type Key = Key[] | string | symbol | number | boolean | Uint8Array;
|
|
|
3
3
|
export function writeKey(key: Key, target: Uint8Array, position: number, inSequence?: boolean): number;
|
|
4
4
|
/** Reads a key from the provided buffer, from the given range */
|
|
5
5
|
export function readKey(buffer: Uint8Array, start: number, end: number, inSequence?: boolean): Key;
|
|
6
|
+
/** Converts key to a Buffer. This is generally much slower than using writeKey since it involves a full buffer allocation, and should be avoided for performance sensitive code. */
|
|
7
|
+
export function toBufferKey(key: Key): Buffer;
|
|
8
|
+
/** Coverts Buffer to Key */
|
|
9
|
+
export function fromBufferKey(source: Buffer): Key;
|
|
6
10
|
/** Compares two keys, returning -1 if `a` comes before `b` in the ordered binary representation of the keys, or 1 if `a` comes after `b`, or 0 if they are equivalent */
|
|
7
11
|
export function compareKeys(a: Key, b: Key): number;
|
|
8
12
|
/** The minimum key, with the "first" binary representation (one byte of zero) */
|
package/index.js
CHANGED
|
@@ -16,8 +16,6 @@ control character types:
|
|
|
16
16
|
|
|
17
17
|
const float64Array = new Float64Array(2)
|
|
18
18
|
const int32Array = new Int32Array(float64Array.buffer, 0, 4)
|
|
19
|
-
const uint8Array6 = new Uint8Array(float64Array.buffer, 2, 6)
|
|
20
|
-
const uint8Array8 = new Uint8Array(float64Array.buffer, 0, 8)
|
|
21
19
|
let nullTerminate = false
|
|
22
20
|
let textEncoder
|
|
23
21
|
try {
|
package/package.json
CHANGED