lib0 0.2.47 → 0.2.48
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/{broadcastchannel-7da37795.cjs → broadcastchannel-f22849e9.cjs} +2 -2
- package/dist/{broadcastchannel-7da37795.cjs.map → broadcastchannel-f22849e9.cjs.map} +1 -1
- package/dist/broadcastchannel.cjs +2 -2
- package/dist/{buffer-b0dea3b0.cjs → buffer-f5603fd0.cjs} +2 -2
- package/dist/buffer-f5603fd0.cjs.map +1 -0
- package/dist/buffer.cjs +1 -1
- package/dist/decoding.cjs +1 -1
- package/dist/encoding.cjs +1 -1
- package/dist/encoding.test.d.ts +1 -0
- package/dist/encoding.test.d.ts.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/{iterator-fe01d209.cjs → iterator-9fc627c1.cjs} +1 -4
- package/dist/iterator-9fc627c1.cjs.map +1 -0
- package/dist/iterator.cjs +1 -1
- package/dist/iterator.d.ts.map +1 -1
- package/dist/metric.d.ts.map +1 -1
- package/dist/{prng-25602bac.cjs → prng-69dc1664.cjs} +2 -2
- package/dist/{prng-25602bac.cjs.map → prng-69dc1664.cjs.map} +1 -1
- package/dist/prng.cjs +2 -2
- package/dist/test.cjs +15 -2
- package/dist/test.cjs.map +1 -1
- package/dist/test.js +15 -2
- package/dist/test.js.map +1 -1
- package/dist/testing.cjs +2 -2
- package/dist/{tree-92f764b3.cjs → tree-b67c7947.cjs} +9 -2
- package/dist/tree-b67c7947.cjs.map +1 -0
- package/dist/tree.cjs +1 -1
- package/dist/tree.d.ts +13 -5
- package/dist/tree.d.ts.map +1 -1
- package/encoding.js +1 -1
- package/encoding.test.d.ts +1 -0
- package/encoding.test.d.ts.map +1 -1
- package/iterator.d.ts.map +1 -1
- package/iterator.js +0 -3
- package/metric.d.ts.map +1 -1
- package/package.json +1 -1
- package/tree.d.ts +13 -5
- package/tree.d.ts.map +1 -1
- package/tree.js +8 -1
- package/dist/buffer-b0dea3b0.cjs.map +0 -1
- package/dist/iterator-fe01d209.cjs.map +0 -1
- package/dist/tree-92f764b3.cjs.map +0 -1
package/dist/test.js
CHANGED
|
@@ -2349,7 +2349,7 @@
|
|
|
2349
2349
|
writeVarString(encoder, data);
|
|
2350
2350
|
break
|
|
2351
2351
|
case 'number':
|
|
2352
|
-
if (isInteger(data) && data <= BITS31) {
|
|
2352
|
+
if (isInteger(data) && abs(data) <= BITS31) {
|
|
2353
2353
|
// TYPE 125: INTEGER
|
|
2354
2354
|
write(encoder, 125);
|
|
2355
2355
|
writeVarInt(encoder, data);
|
|
@@ -5087,6 +5087,18 @@
|
|
|
5087
5087
|
}
|
|
5088
5088
|
};
|
|
5089
5089
|
|
|
5090
|
+
/**
|
|
5091
|
+
* @param {t.TestCase} tc
|
|
5092
|
+
*/
|
|
5093
|
+
const testLargeNumberAnyEncoding = tc => {
|
|
5094
|
+
const encoder = createEncoder();
|
|
5095
|
+
const num = -2.2062063918362897e+50;
|
|
5096
|
+
writeAny(encoder, num);
|
|
5097
|
+
const decoder = createDecoder(toUint8Array(encoder));
|
|
5098
|
+
const readNum = readAny(decoder);
|
|
5099
|
+
assert(readNum === num);
|
|
5100
|
+
};
|
|
5101
|
+
|
|
5090
5102
|
var encoding = /*#__PURE__*/Object.freeze({
|
|
5091
5103
|
__proto__: null,
|
|
5092
5104
|
testGolangBinaryEncodingCompatibility: testGolangBinaryEncodingCompatibility,
|
|
@@ -5117,7 +5129,8 @@
|
|
|
5117
5129
|
testIntDiffRleEncoder: testIntDiffRleEncoder,
|
|
5118
5130
|
testIntEncoders: testIntEncoders,
|
|
5119
5131
|
testIntDiffEncoder: testIntDiffEncoder,
|
|
5120
|
-
testStringDecoder: testStringDecoder
|
|
5132
|
+
testStringDecoder: testStringDecoder,
|
|
5133
|
+
testLargeNumberAnyEncoding: testLargeNumberAnyEncoding
|
|
5121
5134
|
});
|
|
5122
5135
|
|
|
5123
5136
|
/**
|