@peerbit/native-backbone 0.2.2 → 0.2.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peerbit/native-backbone",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Native transaction backbone for Peerbit",
5
5
  "sideEffects": [
6
6
  "./dist/wasm/native_backbone.js"
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "classic-level": "^3.0.0",
55
- "@peerbit/blocks-interface": "2.1.3"
55
+ "@peerbit/blocks-interface": "2.1.4"
56
56
  },
57
57
  "author": "Peerbit contributors",
58
58
  "license": "MIT",
package/src/index.ts CHANGED
@@ -5368,11 +5368,13 @@ class NativeBackboneLogGraph {
5368
5368
  }
5369
5369
 
5370
5370
  entryMetadataHintsBatch(hashes: Iterable<string>): Array<any | undefined> {
5371
- return (
5372
- this.native.graph_entry_metadata_hints_batch ??
5373
- this.native.graph_entry_metadata_batch
5374
- )([...hashes]).map((row) => {
5375
- if (row == null || !this.native.graph_entry_metadata_hints_batch) {
5371
+ const normalized = [...hashes];
5372
+ const usingHints = this.native.graph_entry_metadata_hints_batch != null;
5373
+ const rows = usingHints
5374
+ ? this.native.graph_entry_metadata_hints_batch!(normalized)
5375
+ : this.native.graph_entry_metadata_batch(normalized);
5376
+ return rows.map((row) => {
5377
+ if (row == null || !usingHints) {
5376
5378
  return metadataEntryFromRow(row);
5377
5379
  }
5378
5380
  return requestPruneEntryFromRow(row);