@leofcoin/chain 1.7.29 → 1.7.30

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.
@@ -1419,46 +1419,54 @@ const coerce$1 = (version, options) => {
1419
1419
  };
1420
1420
  var coerce_1 = coerce$1;
1421
1421
 
1422
- class LRUCache {
1423
- constructor () {
1424
- this.max = 1000;
1425
- this.map = new Map();
1426
- }
1422
+ var lrucache;
1423
+ var hasRequiredLrucache;
1424
+
1425
+ function requireLrucache () {
1426
+ if (hasRequiredLrucache) return lrucache;
1427
+ hasRequiredLrucache = 1;
1428
+ class LRUCache {
1429
+ constructor () {
1430
+ this.max = 1000;
1431
+ this.map = new Map();
1432
+ }
1427
1433
 
1428
- get (key) {
1429
- const value = this.map.get(key);
1430
- if (value === undefined) {
1431
- return undefined
1432
- } else {
1433
- // Remove the key from the map and add it to the end
1434
- this.map.delete(key);
1435
- this.map.set(key, value);
1436
- return value
1437
- }
1438
- }
1434
+ get (key) {
1435
+ const value = this.map.get(key);
1436
+ if (value === undefined) {
1437
+ return undefined
1438
+ } else {
1439
+ // Remove the key from the map and add it to the end
1440
+ this.map.delete(key);
1441
+ this.map.set(key, value);
1442
+ return value
1443
+ }
1444
+ }
1439
1445
 
1440
- delete (key) {
1441
- return this.map.delete(key)
1442
- }
1446
+ delete (key) {
1447
+ return this.map.delete(key)
1448
+ }
1443
1449
 
1444
- set (key, value) {
1445
- const deleted = this.delete(key);
1450
+ set (key, value) {
1451
+ const deleted = this.delete(key);
1446
1452
 
1447
- if (!deleted && value !== undefined) {
1448
- // If cache is full, delete the least recently used item
1449
- if (this.map.size >= this.max) {
1450
- const firstKey = this.map.keys().next().value;
1451
- this.delete(firstKey);
1452
- }
1453
+ if (!deleted && value !== undefined) {
1454
+ // If cache is full, delete the least recently used item
1455
+ if (this.map.size >= this.max) {
1456
+ const firstKey = this.map.keys().next().value;
1457
+ this.delete(firstKey);
1458
+ }
1453
1459
 
1454
- this.map.set(key, value);
1455
- }
1460
+ this.map.set(key, value);
1461
+ }
1456
1462
 
1457
- return this
1458
- }
1459
- }
1463
+ return this
1464
+ }
1465
+ }
1460
1466
 
1461
- var lrucache = LRUCache;
1467
+ lrucache = LRUCache;
1468
+ return lrucache;
1469
+ }
1462
1470
 
1463
1471
  var range;
1464
1472
  var hasRequiredRange;
@@ -1680,7 +1688,7 @@ function requireRange () {
1680
1688
 
1681
1689
  range = Range;
1682
1690
 
1683
- const LRU = lrucache;
1691
+ const LRU = requireLrucache();
1684
1692
  const cache = new LRU();
1685
1693
 
1686
1694
  const parseOptions = parseOptions_1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.7.29",
3
+ "version": "1.7.30",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {