corestore 6.16.2 → 6.17.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.
Files changed (2) hide show
  1. package/index.js +3 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -17,6 +17,7 @@ const USERDATA_NAME_KEY = 'corestore/name'
17
17
  const USERDATA_NAMESPACE_KEY = 'corestore/namespace'
18
18
  const POOL_SIZE = 512 // how many open fds to aim for before cycling them
19
19
  const DEFAULT_MANIFEST = 0 // bump to 1 when this is more widely deployed
20
+ const DEFAULT_COMPAT = true
20
21
 
21
22
  module.exports = class Corestore extends ReadyResource {
22
23
  constructor (storage, opts = {}) {
@@ -30,6 +31,7 @@ module.exports = class Corestore extends ReadyResource {
30
31
  this.primaryKey = opts.primaryKey || null
31
32
  this.passive = !!opts.passive
32
33
  this.manifestVersion = typeof opts.manifestVersion === 'number' ? opts.manifestVersion : (root ? root.manifestVersion : DEFAULT_MANIFEST)
34
+ this.compat = typeof opts.compat === 'boolean' ? opts.compat : (root ? root.compat : DEFAULT_COMPAT)
33
35
 
34
36
  this._keyStorage = null
35
37
  this._bootstrap = opts._bootstrap || null
@@ -219,7 +221,7 @@ module.exports = class Corestore extends ReadyResource {
219
221
 
220
222
  const publicKey = opts.publicKey || keyPair.publicKey
221
223
 
222
- if (opts.compat === false) {
224
+ if (opts.compat === false || (opts.compat !== true && !this.compat)) {
223
225
  let manifest = { version: this.manifestVersion, signers: [{ publicKey }] } // default manifest
224
226
  let key = Hypercore.key(manifest)
225
227
  let discoveryKey = crypto.discoveryKey(key)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "corestore",
3
- "version": "6.16.2",
3
+ "version": "6.17.0",
4
4
  "description": "A Hypercore factory that simplifies managing collections of cores.",
5
5
  "main": "index.js",
6
6
  "scripts": {