hypercore 11.16.0 → 11.16.2

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/lib/audit.js CHANGED
@@ -113,7 +113,7 @@ module.exports = async function auditCore (core, { tree = true, blocks = true, b
113
113
 
114
114
  const page = core.bitfield.getBitfield(index)
115
115
  if (page.bitfield) tx.putBitfieldPage(page.index, page.bitfield)
116
- else tx.deleteBitfieldPage(page.idnex)
116
+ else tx.deleteBitfieldPage(page.index)
117
117
  continue
118
118
  }
119
119
 
package/lib/bitfield.js CHANGED
@@ -492,7 +492,7 @@ module.exports = class Bitfield {
492
492
 
493
493
  const pages = Math.ceil(length / BITS_PER_PAGE)
494
494
  const buffer = b4a.alloc(pages * BYTES_PER_PAGE)
495
- const stream = storage.createBitfieldStream()
495
+ const stream = storage.createBitfieldStream({ lt: pages })
496
496
 
497
497
  for await (const { index, page } of stream) {
498
498
  buffer.set(page, index * BYTES_PER_PAGE)
package/lib/core.js CHANGED
@@ -815,9 +815,10 @@ async function getCoreInfo (storage) {
815
815
 
816
816
  r.tryFlush()
817
817
 
818
+ const [authInfo, headInfo, hintsInfo] = await Promise.all([auth, head, hints])
818
819
  return {
819
- ...await auth,
820
- head: await head,
821
- hints: await hints
820
+ ...authInfo,
821
+ head: headInfo,
822
+ hints: hintsInfo
822
823
  }
823
824
  }
package/lib/replicator.js CHANGED
@@ -1752,8 +1752,8 @@ module.exports = class Replicator {
1752
1752
 
1753
1753
  while (session.length > 0) {
1754
1754
  const ref = session[session.length - 1]
1755
- ref.context.detach(ref, err)
1756
1755
  updated.add(ref.context.replicator)
1756
+ ref.context.detach(ref, err)
1757
1757
  }
1758
1758
 
1759
1759
  for (const replicator of updated) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "11.16.0",
3
+ "version": "11.16.2",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -70,6 +70,7 @@
70
70
  "hyperswarm": "^4.3.6",
71
71
  "rache": "^1.0.0",
72
72
  "range-parser": "^1.2.1",
73
+ "resolve-reject-promise": "^1.1.0",
73
74
  "speedometer": "^1.1.0",
74
75
  "standard": "^17.0.0",
75
76
  "test-tmp": "^1.0.2",