@cloudpss/ubjson 0.5.3 → 0.5.6
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/package.json +9 -10
- package/tests/decode.js +9 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudpss/ubjson",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"author": "CloudPSS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -40,14 +40,6 @@
|
|
|
40
40
|
"default": "./dist/rxjs/index.js"
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
"scripts": {
|
|
44
|
-
"start": "yarn clean && tsc --watch",
|
|
45
|
-
"build": "yarn clean && tsc",
|
|
46
|
-
"prepublishOnly": "yarn build",
|
|
47
|
-
"clean": "rimraf dist",
|
|
48
|
-
"benchmark": "node ./benchmark",
|
|
49
|
-
"test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest"
|
|
50
|
-
},
|
|
51
43
|
"devDependencies": {
|
|
52
44
|
"@msgpack/msgpack": "^3.0.0-beta2",
|
|
53
45
|
"@types/lodash": "^4.14.201",
|
|
@@ -55,5 +47,12 @@
|
|
|
55
47
|
},
|
|
56
48
|
"dependencies": {
|
|
57
49
|
"rxjs": "^7.8.1"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"start": "pnpm clean && tsc --watch",
|
|
53
|
+
"build": "pnpm clean && tsc",
|
|
54
|
+
"clean": "rimraf dist",
|
|
55
|
+
"benchmark": "node ./benchmark",
|
|
56
|
+
"test": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --experimental-vm-modules\" jest"
|
|
58
57
|
}
|
|
59
|
-
}
|
|
58
|
+
}
|
package/tests/decode.js
CHANGED
|
@@ -67,31 +67,31 @@ test('decode float64', () => {
|
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
test('decode int8 [unexpected eof]', () => {
|
|
70
|
-
expect(() => decode(toBuffer('i'))).
|
|
70
|
+
expect(() => decode(toBuffer('i'))).toThrow(UnexpectedEof);
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
test('decode uint8 [unexpected eof]', () => {
|
|
74
|
-
expect(() => decode(toBuffer('U'))).
|
|
74
|
+
expect(() => decode(toBuffer('U'))).toThrow(UnexpectedEof);
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
test('decode int16 [unexpected eof]', () => {
|
|
78
|
-
expect(() => decode(toBuffer('I', 0x12))).
|
|
78
|
+
expect(() => decode(toBuffer('I', 0x12))).toThrow(UnexpectedEof);
|
|
79
79
|
});
|
|
80
80
|
|
|
81
81
|
test('decode int32 [unexpected eof]', () => {
|
|
82
|
-
expect(() => decode(toBuffer('l', 0x12, 0x34, 0x56))).
|
|
82
|
+
expect(() => decode(toBuffer('l', 0x12, 0x34, 0x56))).toThrow(UnexpectedEof);
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
test('decode int64 [unexpected eof]', () => {
|
|
86
|
-
expect(() => decode(toBuffer('L', 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde))).
|
|
86
|
+
expect(() => decode(toBuffer('L', 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde))).toThrow(UnexpectedEof);
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
test('decode float32 [unexpected eof]', () => {
|
|
90
|
-
expect(() => decode(toBuffer('d', 0x3f, 0x80, 0x80))).
|
|
90
|
+
expect(() => decode(toBuffer('d', 0x3f, 0x80, 0x80))).toThrow(UnexpectedEof);
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
test('decode float64 [unexpected eof]', () => {
|
|
94
|
-
expect(() => decode(toBuffer('D', 0x40, 0xf8, 0x6a, 0x00, 0x10, 0x00, 0x00))).
|
|
94
|
+
expect(() => decode(toBuffer('D', 0x40, 0xf8, 0x6a, 0x00, 0x10, 0x00, 0x00))).toThrow(UnexpectedEof);
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
test('decode high-precision number [error]', () => {
|
|
@@ -99,7 +99,7 @@ test('decode high-precision number [error]', () => {
|
|
|
99
99
|
});
|
|
100
100
|
|
|
101
101
|
test('decode high-precision number [unexpected eof]', () => {
|
|
102
|
-
expect(() => decode(toBuffer('H', 'i', 3, '1', '.'))).
|
|
102
|
+
expect(() => decode(toBuffer('H', 'i', 3, '1', '.'))).toThrow(UnexpectedEof);
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
test('decode char', () => {
|
|
@@ -107,7 +107,7 @@ test('decode char', () => {
|
|
|
107
107
|
});
|
|
108
108
|
|
|
109
109
|
test('decode char [unexpected eof]', () => {
|
|
110
|
-
expect(() => decode(toBuffer('C'))).
|
|
110
|
+
expect(() => decode(toBuffer('C'))).toThrow(UnexpectedEof);
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
test('decode string', () => {
|