-
Notifications
You must be signed in to change notification settings - Fork 26
/
index.js
38 lines (32 loc) · 726 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class Drivestore {
/**
* @param {import('@synonymdev/slashtags-core-data')} coreData
*/
constructor (coreData) {
this._coreData = coreData
this.corestore = this._coreData._corestoreSession
}
/**
* @deprecated
*/
[Symbol.asyncIterator] () {
return new Error('not supported')
}
get closed () {
return this.corestore._root.closing
}
ready () {
return this._coreData.ready()
}
/** @param {Parameters<import('corestore')['replicate']>} args */
replicate (...args) {
return this.corestore.replicate(...args)
}
/**
* Get a Hyperdrive by its name.
*/
get (name = 'public') {
return this._coreData._getLocalDrive(name)
}
}
module.exports = Drivestore