@typeberry/convert 0.1.2-7ebe1f6 → 0.1.2-b99f2bee

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 (3) hide show
  1. package/index.js +25 -42
  2. package/index.js.map +1 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -4477,7 +4477,7 @@ function assert (t, m) {
4477
4477
 
4478
4478
  /***/ }),
4479
4479
 
4480
- /***/ 405:
4480
+ /***/ 786:
4481
4481
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
4482
4482
 
4483
4483
  module.exports = __nccwpck_require__.p + "6b655f8772c01b768329.js?bandersnatch_bg.wasm";
@@ -4605,8 +4605,6 @@ module.exports = __nccwpck_require__.p + "ccf8ada94096a8f232f5.js?reed_solomon_w
4605
4605
  /************************************************************************/
4606
4606
  var __webpack_exports__ = {};
4607
4607
 
4608
- ;// CONCATENATED MODULE: external "node:url"
4609
- const external_node_url_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:url");
4610
4608
  ;// CONCATENATED MODULE: ./packages/core/logger/options.ts
4611
4609
  var Level;
4612
4610
  (function (Level) {
@@ -4697,8 +4695,8 @@ function print(level, levelAndName, strings, data) {
4697
4695
  return;
4698
4696
  }
4699
4697
  const lvlText = Level[level].padEnd(5);
4700
- const val = strings.map((v, idx) => `${v}${idx < data.length ? data[idx] : ""}`);
4701
- const msg = `${lvlText} [${levelAndName[1]}] ${val.join("")}`;
4698
+ const val = strings.map((v, idx) => `${v}${data[idx]}`);
4699
+ const msg = `${lvlText} [${levelAndName[1]}] ${val}`;
4702
4700
  if (level === Level.WARN) {
4703
4701
  console.warn(msg);
4704
4702
  }
@@ -7599,7 +7597,7 @@ async function __wbg_init$2(module_or_path) {
7599
7597
  if (wasm$2 !== void 0) return wasm$2;
7600
7598
  if (typeof module_or_path !== "undefined") if (Object.getPrototypeOf(module_or_path) === Object.prototype) ({module_or_path} = module_or_path);
7601
7599
  else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
7602
- if (typeof module_or_path === "undefined") module_or_path = new URL(/* asset import */ __nccwpck_require__(405), __nccwpck_require__.b);
7600
+ if (typeof module_or_path === "undefined") module_or_path = new URL(/* asset import */ __nccwpck_require__(786), __nccwpck_require__.b);
7603
7601
  const imports = __wbg_get_imports$2();
7604
7602
  if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) module_or_path = fetch(module_or_path);
7605
7603
  __wbg_init_memory$2(imports);
@@ -17475,17 +17473,6 @@ class page_range_PageRange {
17475
17473
  }
17476
17474
  return new page_range_PageRange(start, length);
17477
17475
  }
17478
- /** Returns true if the page range is wrapped (`start` >= `end`) and is not empty */
17479
- isWrapped() {
17480
- return this.start >= this.end && !this.isEmpty();
17481
- }
17482
- /** Checks if given page number is within the range */
17483
- isInRange(page) {
17484
- if (this.isWrapped()) {
17485
- return page >= this.start || page < this.end;
17486
- }
17487
- return page >= this.start && page < this.end;
17488
- }
17489
17476
  /** Checks if a range is empty (`length === 0`) */
17490
17477
  isEmpty() {
17491
17478
  return this.length === 0;
@@ -17865,11 +17852,10 @@ class memory_builder_MemoryBuilder {
17865
17852
  startHeapIndex (${startHeapIndex}) has to be less than or equal to endHeapIndex (${endHeapIndex})
17866
17853
  `;
17867
17854
  this.ensureNotFinalized();
17868
- const heapRange = MemoryRange.fromStartAndLength(startHeapIndex, endHeapIndex - startHeapIndex);
17869
- const heapPagesRange = PageRange.fromMemoryRange(heapRange);
17870
- const initializedPageNumbers = Array.from(this.initialMemory.keys());
17871
- for (const pageNumber of initializedPageNumbers) {
17872
- if (heapPagesRange.isInRange(pageNumber)) {
17855
+ const range = MemoryRange.fromStartAndLength(startHeapIndex, endHeapIndex - startHeapIndex);
17856
+ const pages = PageRange.fromMemoryRange(range);
17857
+ for (const pageNumber of pages) {
17858
+ if (this.initialMemory.has(pageNumber)) {
17873
17859
  throw new IncorrectSbrkIndex();
17874
17860
  }
17875
17861
  }
@@ -27423,26 +27409,23 @@ function loadAndProcessDataFile(file, withRelPath, flavor, decodeType, process)
27423
27409
 
27424
27410
 
27425
27411
 
27426
-
27427
- if (import.meta.url === (0,external_node_url_namespaceObject.pathToFileURL)(process.argv[1]).href) {
27428
- Logger.configureAll(process.env.JAM_LOG ?? "", Level.LOG);
27429
- const withRelPath = workspacePathFix(`${import.meta.dirname}/../..`);
27430
- let args;
27431
- try {
27432
- args = parseArgs(process.argv.slice(2), withRelPath);
27433
- }
27434
- catch (e) {
27435
- console.error(`\n${e}\n`);
27436
- console.info(HELP);
27437
- process.exit(1);
27438
- }
27439
- try {
27440
- main(args, withRelPath);
27441
- }
27442
- catch (e) {
27443
- console.error(`${e}`);
27444
- process.exit(-1);
27445
- }
27412
+ Logger.configureAll(process.env.JAM_LOG ?? "", Level.LOG);
27413
+ const withRelPath = workspacePathFix(`${import.meta.dirname}/../..`);
27414
+ let args;
27415
+ try {
27416
+ args = parseArgs(process.argv.slice(2), withRelPath);
27417
+ }
27418
+ catch (e) {
27419
+ console.error(`\n${e}\n`);
27420
+ console.info(HELP);
27421
+ process.exit(1);
27422
+ }
27423
+ try {
27424
+ main(args, withRelPath);
27425
+ }
27426
+ catch (e) {
27427
+ console.error(`${e}`);
27428
+ process.exit(-1);
27446
27429
  }
27447
27430
 
27448
27431