hypercore 10.28.1 → 10.28.3

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 (2) hide show
  1. package/lib/batch.js +6 -0
  2. package/package.json +1 -1
package/lib/batch.js CHANGED
@@ -88,6 +88,12 @@ module.exports = class HypercoreBatch extends EventEmitter {
88
88
  this.emit('ready')
89
89
  }
90
90
 
91
+ async has (index) {
92
+ if (this.opened === false) await this.ready()
93
+ if (index >= this._sessionLength) return index < this.length
94
+ return this.session.has(index)
95
+ }
96
+
91
97
  async update (opts) {
92
98
  if (this.opened === false) await this.ready()
93
99
  await this.session.update(opts)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "10.28.1",
3
+ "version": "10.28.3",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {