hypercore 10.2.2 → 10.3.0
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 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -170,14 +170,15 @@ module.exports = class Hypercore extends EventEmitter {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
const directory = storage
|
|
173
|
-
const toLock = opts.lock || 'oplog'
|
|
173
|
+
const toLock = opts.unlocked ? null : (opts.lock || 'oplog')
|
|
174
|
+
const pool = opts.pool || null
|
|
174
175
|
|
|
175
176
|
return createFile
|
|
176
177
|
|
|
177
178
|
function createFile (name) {
|
|
178
|
-
const lock = isFile(name, toLock)
|
|
179
|
+
const lock = toLock === null ? false : isFile(name, toLock)
|
|
179
180
|
const sparse = isFile(name, 'data') || isFile(name, 'bitfield') || isFile(name, 'tree')
|
|
180
|
-
return new RAF(name, { directory, lock, sparse })
|
|
181
|
+
return new RAF(name, { directory, lock, sparse, pool })
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
function isFile (name, n) {
|