Skip to content

Commit ce39ec0

Browse files
committed
add some getters for ease of use
1 parent d749e86 commit ce39ec0

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

index.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,21 @@ class Hyperblobs {
7474
this.blockSize = opts.blockSize || DEFAULT_BLOCK_SIZE
7575

7676
this._lock = mutexify()
77-
this._core = core
7877
this._monitors = new Set()
7978

8079
this._boundUpdatePeers = this._updatePeers.bind(this)
8180
this._boundOnUpload = this._onUpload.bind(this)
8281
this._boundOnDownload = this._onDownload.bind(this)
8382
}
8483

84+
get key () {
85+
return this.core.key
86+
}
87+
88+
get discoveryKey () {
89+
return this.core.discoveryKey
90+
}
91+
8592
get feed () {
8693
return this.core
8794
}
@@ -90,6 +97,10 @@ class Hyperblobs {
9097
return this._lock.locked
9198
}
9299

100+
replicate (isInitiator, opts) {
101+
return this.core.replicate(isInitiator, opts)
102+
}
103+
93104
ready () {
94105
return this.core.ready()
95106
}
@@ -160,12 +171,12 @@ class Hyperblobs {
160171
}
161172

162173
createReadStream (id, opts) {
163-
const core = (opts && opts.core) ? opts.core : this._core
174+
const core = (opts && opts.core) ? opts.core : this.core
164175
return new BlobReadStream(core, id, opts)
165176
}
166177

167178
createWriteStream (opts) {
168-
const core = (opts && opts.core) ? opts.core : this._core
179+
const core = (opts && opts.core) ? opts.core : this.core
169180
return new BlobWriteStream(core, this._lock, opts)
170181
}
171182

0 commit comments

Comments
 (0)