corestore 6.9.0 → 6.10.1
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/index.js +9 -0
- package/package.json +9 -8
package/index.js
CHANGED
|
@@ -43,11 +43,20 @@ module.exports = class Corestore extends ReadyResource {
|
|
|
43
43
|
|
|
44
44
|
this._findingPeersCount = 0
|
|
45
45
|
this._findingPeers = []
|
|
46
|
+
this._isCorestore = true
|
|
46
47
|
|
|
47
48
|
if (this._namespace.byteLength !== 32) throw new Error('Namespace must be a 32-byte Buffer or Uint8Array')
|
|
48
49
|
this.ready().catch(safetyCatch)
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
static isCorestore (obj) {
|
|
53
|
+
return !!(typeof obj === 'object' && obj && obj._isCorestore)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static from (storage, opts) {
|
|
57
|
+
return this.isCorestore(storage) ? storage : new this(storage, opts)
|
|
58
|
+
}
|
|
59
|
+
|
|
51
60
|
// for now just release the lock...
|
|
52
61
|
async suspend () {
|
|
53
62
|
if (this._root !== this) return this._root.suspend()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "corestore",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.10.1",
|
|
4
4
|
"description": "A Hypercore factory that simplifies managing collections of cores.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -24,15 +24,16 @@
|
|
|
24
24
|
"lib/**.js"
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"brittle": "^3.
|
|
28
|
-
"random-access-memory": "^6.
|
|
29
|
-
"
|
|
27
|
+
"brittle": "^3.2.2",
|
|
28
|
+
"random-access-memory": "^6.2.0",
|
|
29
|
+
"standard": "^17.1.0",
|
|
30
|
+
"test-tmp": "^1.0.2"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"b4a": "^1.
|
|
33
|
-
"hypercore": "^10.
|
|
34
|
-
"hypercore-crypto": "^3.
|
|
35
|
-
"hypercore-id-encoding": "^1.
|
|
33
|
+
"b4a": "^1.6.4",
|
|
34
|
+
"hypercore": "^10.18.2",
|
|
35
|
+
"hypercore-crypto": "^3.4.0",
|
|
36
|
+
"hypercore-id-encoding": "^1.2.0",
|
|
36
37
|
"read-write-mutexify": "^2.1.0",
|
|
37
38
|
"ready-resource": "^1.0.0",
|
|
38
39
|
"safety-catch": "^1.0.1",
|