Comparing version 2.19.7 to 2.20.0
25
index.js
@@ -8,3 +8,4 @@ const codecs = require('codecs') | ||
const debounce = require('debounceify') | ||
const Xache = require('xache') | ||
const Rache = require('rache') | ||
const { all: unslabAll } = require('unslab') | ||
@@ -42,4 +43,4 @@ | ||
class Cache { | ||
constructor (maxSize) { | ||
this.keys = new Xache({ maxSize }) | ||
constructor (rache) { | ||
this.keys = rache | ||
this.length = 0 | ||
@@ -392,5 +393,4 @@ } | ||
const maxCacheSize = opts.maxCacheSize || 65536 | ||
this._keyCache = new Cache(maxCacheSize) | ||
this._nodeCache = new Cache(maxCacheSize) | ||
this._keyCache = null | ||
this._nodeCache = null | ||
@@ -409,4 +409,8 @@ this._batches = [] | ||
_open () { | ||
return this.core.ready() | ||
async _open () { | ||
await this.core.ready() | ||
const baseCache = Rache.from(this.core.globalCache) | ||
this._keyCache = new Cache(baseCache) | ||
this._nodeCache = new Cache(Rache.from(baseCache)) | ||
} | ||
@@ -438,7 +442,2 @@ | ||
get maxCacheSize () { | ||
// Note: the key cache and the node cache have the same size | ||
return this._keyCache.keys.maxSize | ||
} | ||
replicate (isInitiator, opts) { | ||
@@ -445,0 +444,0 @@ return this.core.replicate(isInitiator, opts) |
{ | ||
"name": "hyperbee", | ||
"version": "2.19.7", | ||
"version": "2.20.0", | ||
"description": "An append-only B-tree running on a Hypercore.", | ||
@@ -18,11 +18,11 @@ "main": "index.js", | ||
"protocol-buffers-encodings": "^1.2.0", | ||
"rache": "^1.0.0", | ||
"ready-resource": "^1.0.0", | ||
"safety-catch": "^1.0.2", | ||
"streamx": "^2.12.4", | ||
"unslab": "^1.2.0", | ||
"xache": "^1.2.1" | ||
"unslab": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"brittle": "^3.1.0", | ||
"hypercore": "^10.18.0", | ||
"hypercore": "^10.37.10", | ||
"protocol-buffers": "^4.2.0", | ||
@@ -29,0 +29,0 @@ "random-access-memory": "^6.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97545
2694
+ Addedrache@^1.0.0
+ Addedrache@1.0.0(transitive)
- Removedxache@^1.2.1
- Removedxache@1.2.1(transitive)