hypercore-storage 0.0.39 → 0.0.41

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/index.js +5 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -152,7 +152,7 @@ class WriteBatch {
152
152
  const s = encodeDataIndex(this.storage.dataPointer, type, start)
153
153
  const e = encodeDataIndex(this.storage.dataPointer, type, end === -1 ? Infinity : end)
154
154
 
155
- return this.write.deleteRange(s, e)
155
+ return this.write.tryDeleteRange(s, e)
156
156
  }
157
157
 
158
158
  destroy () {
@@ -417,6 +417,10 @@ module.exports = class CoreStorage {
417
417
  this.mutex = new RW()
418
418
  }
419
419
 
420
+ static isCoreStorage (s) {
421
+ return !!s && typeof s.setLocalSeed === 'function'
422
+ }
423
+
420
424
  // just a helper to make tests easier
421
425
  static async clear (dir) {
422
426
  const s = new this(dir)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore-storage",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "main": "index.js",
5
5
  "files": [
6
6
  "index.js",