msgpackr 1.5.7 → 1.6.2
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.js +1929 -1917
- package/dist/index.min.js +67 -68
- package/dist/node.cjs +1994 -1979
- package/dist/test.js +697 -674
- package/index.d.ts +23 -12
- package/node-index.js +23 -20
- package/pack.js +935 -931
- package/package.json +14 -2
- package/unpack.d.ts +52 -50
- package/unpack.js +1061 -1053
- package/dist/str.cjs +0 -100
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "msgpackr",
|
|
3
3
|
"author": "Kris Zyp",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.2",
|
|
5
5
|
"description": "Ultra-fast MessagePack implementation with extensions for records and structured cloning",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"types": "./index.d.ts",
|
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
"require": "./dist/node.cjs",
|
|
33
33
|
"import": "./node-index.js"
|
|
34
34
|
},
|
|
35
|
+
"bun": {
|
|
36
|
+
"require": "./dist/node.cjs",
|
|
37
|
+
"import": "./node-index.js"
|
|
38
|
+
},
|
|
35
39
|
"default": "./index.js"
|
|
36
40
|
},
|
|
37
41
|
"./pack": {
|
|
@@ -39,6 +43,10 @@
|
|
|
39
43
|
"import": "./index.js",
|
|
40
44
|
"require": "./dist/node.cjs"
|
|
41
45
|
},
|
|
46
|
+
"bun": {
|
|
47
|
+
"import": "./index.js",
|
|
48
|
+
"require": "./dist/node.cjs"
|
|
49
|
+
},
|
|
42
50
|
"default": "./pack.js"
|
|
43
51
|
},
|
|
44
52
|
"./unpack": {
|
|
@@ -46,6 +54,10 @@
|
|
|
46
54
|
"import": "./index.js",
|
|
47
55
|
"require": "./dist/node.cjs"
|
|
48
56
|
},
|
|
57
|
+
"bun": {
|
|
58
|
+
"import": "./index.js",
|
|
59
|
+
"require": "./dist/node.cjs"
|
|
60
|
+
},
|
|
49
61
|
"default": "./unpack.js"
|
|
50
62
|
}
|
|
51
63
|
},
|
|
@@ -56,7 +68,7 @@
|
|
|
56
68
|
"/*.ts"
|
|
57
69
|
],
|
|
58
70
|
"optionalDependencies": {
|
|
59
|
-
"msgpackr-extract": "^
|
|
71
|
+
"msgpackr-extract": "^2.0.2"
|
|
60
72
|
},
|
|
61
73
|
"devDependencies": {
|
|
62
74
|
"@rollup/plugin-json": "^4.1.0",
|
package/unpack.d.ts
CHANGED
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
export enum FLOAT32_OPTIONS {
|
|
2
|
-
NEVER = 0,
|
|
3
|
-
ALWAYS = 1,
|
|
4
|
-
DECIMAL_ROUND = 3,
|
|
5
|
-
DECIMAL_FIT = 4
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface Options {
|
|
9
|
-
useFloat32?: FLOAT32_OPTIONS
|
|
10
|
-
useRecords?: boolean
|
|
11
|
-
structures?: {}[]
|
|
12
|
-
moreTypes?: boolean
|
|
13
|
-
structuredClone?: boolean
|
|
14
|
-
mapsAsObjects?: boolean
|
|
15
|
-
variableMapSize?: boolean
|
|
16
|
-
copyBuffers?: boolean
|
|
17
|
-
bundleStrings?: boolean
|
|
18
|
-
useTimestamp32?: boolean
|
|
19
|
-
largeBigIntToFloat?: boolean
|
|
20
|
-
encodeUndefinedAsNil?: boolean
|
|
21
|
-
maxSharedStructures?: number
|
|
22
|
-
maxOwnStructures?: number
|
|
23
|
-
int64AsNumber?: boolean
|
|
24
|
-
shouldShareStructure?: (keys: string[]) => boolean
|
|
25
|
-
getStructures?(): {}[]
|
|
26
|
-
saveStructures?(structures: {}[]): boolean | void
|
|
27
|
-
onInvalidDate?: () => any
|
|
28
|
-
}
|
|
29
|
-
interface Extension {
|
|
30
|
-
Class: Function
|
|
31
|
-
type: number
|
|
32
|
-
pack?(value: any): Buffer | Uint8Array
|
|
33
|
-
unpack?(messagePack: Buffer | Uint8Array): any
|
|
34
|
-
read?(datum: any): any
|
|
35
|
-
write?(instance: any): any
|
|
36
|
-
}
|
|
37
|
-
export class Unpackr {
|
|
38
|
-
constructor(options?: Options)
|
|
39
|
-
unpack(messagePack: Buffer | Uint8Array): any
|
|
40
|
-
decode(messagePack: Buffer | Uint8Array): any
|
|
41
|
-
unpackMultiple(messagePack: Buffer | Uint8Array
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
export
|
|
45
|
-
export function
|
|
46
|
-
export function
|
|
47
|
-
export function
|
|
48
|
-
export function
|
|
49
|
-
export function
|
|
50
|
-
export
|
|
1
|
+
export enum FLOAT32_OPTIONS {
|
|
2
|
+
NEVER = 0,
|
|
3
|
+
ALWAYS = 1,
|
|
4
|
+
DECIMAL_ROUND = 3,
|
|
5
|
+
DECIMAL_FIT = 4
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface Options {
|
|
9
|
+
useFloat32?: FLOAT32_OPTIONS
|
|
10
|
+
useRecords?: boolean
|
|
11
|
+
structures?: {}[]
|
|
12
|
+
moreTypes?: boolean
|
|
13
|
+
structuredClone?: boolean
|
|
14
|
+
mapsAsObjects?: boolean
|
|
15
|
+
variableMapSize?: boolean
|
|
16
|
+
copyBuffers?: boolean
|
|
17
|
+
bundleStrings?: boolean
|
|
18
|
+
useTimestamp32?: boolean
|
|
19
|
+
largeBigIntToFloat?: boolean
|
|
20
|
+
encodeUndefinedAsNil?: boolean
|
|
21
|
+
maxSharedStructures?: number
|
|
22
|
+
maxOwnStructures?: number
|
|
23
|
+
int64AsNumber?: boolean
|
|
24
|
+
shouldShareStructure?: (keys: string[]) => boolean
|
|
25
|
+
getStructures?(): {}[]
|
|
26
|
+
saveStructures?(structures: {}[]): boolean | void
|
|
27
|
+
onInvalidDate?: () => any
|
|
28
|
+
}
|
|
29
|
+
interface Extension {
|
|
30
|
+
Class: Function
|
|
31
|
+
type: number
|
|
32
|
+
pack?(value: any): Buffer | Uint8Array
|
|
33
|
+
unpack?(messagePack: Buffer | Uint8Array): any
|
|
34
|
+
read?(datum: any): any
|
|
35
|
+
write?(instance: any): any
|
|
36
|
+
}
|
|
37
|
+
export class Unpackr {
|
|
38
|
+
constructor(options?: Options)
|
|
39
|
+
unpack(messagePack: Buffer | Uint8Array): any
|
|
40
|
+
decode(messagePack: Buffer | Uint8Array): any
|
|
41
|
+
unpackMultiple(messagePack: Buffer | Uint8Array): any[]
|
|
42
|
+
unpackMultiple(messagePack: Buffer | Uint8Array, forEach: (value: any) => any): void
|
|
43
|
+
}
|
|
44
|
+
export class Decoder extends Unpackr {}
|
|
45
|
+
export function unpack(messagePack: Buffer | Uint8Array): any
|
|
46
|
+
export function unpackMultiple(messagePack: Buffer | Uint8Array): any[]
|
|
47
|
+
export function unpackMultiple(messagePack: Buffer | Uint8Array, forEach: (value: any) => any): void
|
|
48
|
+
export function decode(messagePack: Buffer | Uint8Array): any
|
|
49
|
+
export function addExtension(extension: Extension): void
|
|
50
|
+
export function clearSource(): void
|
|
51
|
+
export function roundFloat32(float32Number: number): number
|
|
52
|
+
export const C1: {}
|
|
51
53
|
export let isNativeAccelerationEnabled: boolean
|