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.
Files changed (42) hide show
  1. package/dist/{broadcastchannel-7da37795.cjs → broadcastchannel-f22849e9.cjs} +2 -2
  2. package/dist/{broadcastchannel-7da37795.cjs.map → broadcastchannel-f22849e9.cjs.map} +1 -1
  3. package/dist/broadcastchannel.cjs +2 -2
  4. package/dist/{buffer-b0dea3b0.cjs → buffer-f5603fd0.cjs} +2 -2
  5. package/dist/buffer-f5603fd0.cjs.map +1 -0
  6. package/dist/buffer.cjs +1 -1
  7. package/dist/decoding.cjs +1 -1
  8. package/dist/encoding.cjs +1 -1
  9. package/dist/encoding.test.d.ts +1 -0
  10. package/dist/encoding.test.d.ts.map +1 -1
  11. package/dist/index.cjs +5 -5
  12. package/dist/{iterator-fe01d209.cjs → iterator-9fc627c1.cjs} +1 -4
  13. package/dist/iterator-9fc627c1.cjs.map +1 -0
  14. package/dist/iterator.cjs +1 -1
  15. package/dist/iterator.d.ts.map +1 -1
  16. package/dist/metric.d.ts.map +1 -1
  17. package/dist/{prng-25602bac.cjs → prng-69dc1664.cjs} +2 -2
  18. package/dist/{prng-25602bac.cjs.map → prng-69dc1664.cjs.map} +1 -1
  19. package/dist/prng.cjs +2 -2
  20. package/dist/test.cjs +15 -2
  21. package/dist/test.cjs.map +1 -1
  22. package/dist/test.js +15 -2
  23. package/dist/test.js.map +1 -1
  24. package/dist/testing.cjs +2 -2
  25. package/dist/{tree-92f764b3.cjs → tree-b67c7947.cjs} +9 -2
  26. package/dist/tree-b67c7947.cjs.map +1 -0
  27. package/dist/tree.cjs +1 -1
  28. package/dist/tree.d.ts +13 -5
  29. package/dist/tree.d.ts.map +1 -1
  30. package/encoding.js +1 -1
  31. package/encoding.test.d.ts +1 -0
  32. package/encoding.test.d.ts.map +1 -1
  33. package/iterator.d.ts.map +1 -1
  34. package/iterator.js +0 -3
  35. package/metric.d.ts.map +1 -1
  36. package/package.json +1 -1
  37. package/tree.d.ts +13 -5
  38. package/tree.d.ts.map +1 -1
  39. package/tree.js +8 -1
  40. package/dist/buffer-b0dea3b0.cjs.map +0 -1
  41. package/dist/iterator-fe01d209.cjs.map +0 -1
  42. 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
  /**