@leofcoin/peernet 0.14.5 → 0.14.7

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.
@@ -3220,8 +3220,9 @@ class LeofcoinStorage {
3220
3220
  async get(key) {
3221
3221
  if (!key) return this.query()
3222
3222
  if (typeof key === 'object') return this.many('get', key);
3223
- return new KeyValue(await this.db.get(new KeyPath(key))).toString()
3223
+ return this.db.get(new KeyPath(key))
3224
3224
  }
3225
+
3225
3226
  /**
3226
3227
  *
3227
3228
  * @param {*} key
@@ -3268,6 +3269,16 @@ class LeofcoinStorage {
3268
3269
  return Promise.all(promises)
3269
3270
  }
3270
3271
 
3272
+ async values() {
3273
+ const keys = await this.keys();
3274
+
3275
+ let promises = [];
3276
+ for (const key of keys) {
3277
+ promises.push(this.db.get(key));
3278
+ }
3279
+ return Promise.all(promises)
3280
+ }
3281
+
3271
3282
  async many(type, _value) {
3272
3283
  const jobs = [];
3273
3284
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/peernet",
3
- "version": "0.14.5",
3
+ "version": "0.14.7",
4
4
  "description": "",
5
5
  "source": "src/peernet.js",
6
6
  "main": "dist/commonjs/peernet.js",