hypercore 10.0.0-alpha.43 → 10.0.0-alpha.44
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 +4 -2
- package/lib/replicator.js +3 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -191,8 +191,10 @@ module.exports = class Hypercore extends EventEmitter {
|
|
|
191
191
|
|
|
192
192
|
s._passCapabilities(this)
|
|
193
193
|
|
|
194
|
-
//
|
|
195
|
-
if (opts.cache !== false)
|
|
194
|
+
// Configure the cache unless explicitly disabled.
|
|
195
|
+
if (opts.cache !== false) {
|
|
196
|
+
s.cache = opts.cache === true || !opts.cache ? this.cache : opts.cache
|
|
197
|
+
}
|
|
196
198
|
|
|
197
199
|
ensureEncryption(s, opts)
|
|
198
200
|
|
package/lib/replicator.js
CHANGED
|
@@ -910,9 +910,9 @@ module.exports = class Replicator {
|
|
|
910
910
|
}
|
|
911
911
|
|
|
912
912
|
addRange (session, { start = 0, end = -1, length = toLength(start, end), blocks = null, linear = false } = {}) {
|
|
913
|
-
if (blocks !== null) {
|
|
914
|
-
|
|
915
|
-
|
|
913
|
+
if (blocks !== null) { // if using blocks, start, end just acts as frames around the blocks array
|
|
914
|
+
start = 0
|
|
915
|
+
end = length = blocks.length
|
|
916
916
|
}
|
|
917
917
|
|
|
918
918
|
const r = new RangeRequest(this._ranges, start, length === -1 ? -1 : start + length, linear, blocks)
|