@leofcoin/chain 1.6.0 → 1.6.1

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.
@@ -1432,781 +1432,764 @@ function requireIterator () {
1432
1432
  return iterator;
1433
1433
  }
1434
1434
 
1435
- var yallist;
1436
- var hasRequiredYallist;
1435
+ var yallist = Yallist$1;
1437
1436
 
1438
- function requireYallist () {
1439
- if (hasRequiredYallist) return yallist;
1440
- hasRequiredYallist = 1;
1441
- yallist = Yallist;
1437
+ Yallist$1.Node = Node;
1438
+ Yallist$1.create = Yallist$1;
1442
1439
 
1443
- Yallist.Node = Node;
1444
- Yallist.create = Yallist;
1445
-
1446
- function Yallist (list) {
1447
- var self = this;
1448
- if (!(self instanceof Yallist)) {
1449
- self = new Yallist();
1450
- }
1451
-
1452
- self.tail = null;
1453
- self.head = null;
1454
- self.length = 0;
1440
+ function Yallist$1 (list) {
1441
+ var self = this;
1442
+ if (!(self instanceof Yallist$1)) {
1443
+ self = new Yallist$1();
1444
+ }
1455
1445
 
1456
- if (list && typeof list.forEach === 'function') {
1457
- list.forEach(function (item) {
1458
- self.push(item);
1459
- });
1460
- } else if (arguments.length > 0) {
1461
- for (var i = 0, l = arguments.length; i < l; i++) {
1462
- self.push(arguments[i]);
1463
- }
1464
- }
1446
+ self.tail = null;
1447
+ self.head = null;
1448
+ self.length = 0;
1465
1449
 
1466
- return self
1467
- }
1450
+ if (list && typeof list.forEach === 'function') {
1451
+ list.forEach(function (item) {
1452
+ self.push(item);
1453
+ });
1454
+ } else if (arguments.length > 0) {
1455
+ for (var i = 0, l = arguments.length; i < l; i++) {
1456
+ self.push(arguments[i]);
1457
+ }
1458
+ }
1468
1459
 
1469
- Yallist.prototype.removeNode = function (node) {
1470
- if (node.list !== this) {
1471
- throw new Error('removing node which does not belong to this list')
1472
- }
1460
+ return self
1461
+ }
1473
1462
 
1474
- var next = node.next;
1475
- var prev = node.prev;
1463
+ Yallist$1.prototype.removeNode = function (node) {
1464
+ if (node.list !== this) {
1465
+ throw new Error('removing node which does not belong to this list')
1466
+ }
1476
1467
 
1477
- if (next) {
1478
- next.prev = prev;
1479
- }
1468
+ var next = node.next;
1469
+ var prev = node.prev;
1480
1470
 
1481
- if (prev) {
1482
- prev.next = next;
1483
- }
1471
+ if (next) {
1472
+ next.prev = prev;
1473
+ }
1484
1474
 
1485
- if (node === this.head) {
1486
- this.head = next;
1487
- }
1488
- if (node === this.tail) {
1489
- this.tail = prev;
1490
- }
1475
+ if (prev) {
1476
+ prev.next = next;
1477
+ }
1491
1478
 
1492
- node.list.length--;
1493
- node.next = null;
1494
- node.prev = null;
1495
- node.list = null;
1479
+ if (node === this.head) {
1480
+ this.head = next;
1481
+ }
1482
+ if (node === this.tail) {
1483
+ this.tail = prev;
1484
+ }
1496
1485
 
1497
- return next
1498
- };
1486
+ node.list.length--;
1487
+ node.next = null;
1488
+ node.prev = null;
1489
+ node.list = null;
1499
1490
 
1500
- Yallist.prototype.unshiftNode = function (node) {
1501
- if (node === this.head) {
1502
- return
1503
- }
1491
+ return next
1492
+ };
1504
1493
 
1505
- if (node.list) {
1506
- node.list.removeNode(node);
1507
- }
1494
+ Yallist$1.prototype.unshiftNode = function (node) {
1495
+ if (node === this.head) {
1496
+ return
1497
+ }
1508
1498
 
1509
- var head = this.head;
1510
- node.list = this;
1511
- node.next = head;
1512
- if (head) {
1513
- head.prev = node;
1514
- }
1499
+ if (node.list) {
1500
+ node.list.removeNode(node);
1501
+ }
1515
1502
 
1516
- this.head = node;
1517
- if (!this.tail) {
1518
- this.tail = node;
1519
- }
1520
- this.length++;
1521
- };
1503
+ var head = this.head;
1504
+ node.list = this;
1505
+ node.next = head;
1506
+ if (head) {
1507
+ head.prev = node;
1508
+ }
1522
1509
 
1523
- Yallist.prototype.pushNode = function (node) {
1524
- if (node === this.tail) {
1525
- return
1526
- }
1510
+ this.head = node;
1511
+ if (!this.tail) {
1512
+ this.tail = node;
1513
+ }
1514
+ this.length++;
1515
+ };
1527
1516
 
1528
- if (node.list) {
1529
- node.list.removeNode(node);
1530
- }
1517
+ Yallist$1.prototype.pushNode = function (node) {
1518
+ if (node === this.tail) {
1519
+ return
1520
+ }
1531
1521
 
1532
- var tail = this.tail;
1533
- node.list = this;
1534
- node.prev = tail;
1535
- if (tail) {
1536
- tail.next = node;
1537
- }
1522
+ if (node.list) {
1523
+ node.list.removeNode(node);
1524
+ }
1538
1525
 
1539
- this.tail = node;
1540
- if (!this.head) {
1541
- this.head = node;
1542
- }
1543
- this.length++;
1544
- };
1526
+ var tail = this.tail;
1527
+ node.list = this;
1528
+ node.prev = tail;
1529
+ if (tail) {
1530
+ tail.next = node;
1531
+ }
1545
1532
 
1546
- Yallist.prototype.push = function () {
1547
- for (var i = 0, l = arguments.length; i < l; i++) {
1548
- push(this, arguments[i]);
1549
- }
1550
- return this.length
1551
- };
1533
+ this.tail = node;
1534
+ if (!this.head) {
1535
+ this.head = node;
1536
+ }
1537
+ this.length++;
1538
+ };
1552
1539
 
1553
- Yallist.prototype.unshift = function () {
1554
- for (var i = 0, l = arguments.length; i < l; i++) {
1555
- unshift(this, arguments[i]);
1556
- }
1557
- return this.length
1558
- };
1540
+ Yallist$1.prototype.push = function () {
1541
+ for (var i = 0, l = arguments.length; i < l; i++) {
1542
+ push(this, arguments[i]);
1543
+ }
1544
+ return this.length
1545
+ };
1559
1546
 
1560
- Yallist.prototype.pop = function () {
1561
- if (!this.tail) {
1562
- return undefined
1563
- }
1547
+ Yallist$1.prototype.unshift = function () {
1548
+ for (var i = 0, l = arguments.length; i < l; i++) {
1549
+ unshift(this, arguments[i]);
1550
+ }
1551
+ return this.length
1552
+ };
1564
1553
 
1565
- var res = this.tail.value;
1566
- this.tail = this.tail.prev;
1567
- if (this.tail) {
1568
- this.tail.next = null;
1569
- } else {
1570
- this.head = null;
1571
- }
1572
- this.length--;
1573
- return res
1574
- };
1554
+ Yallist$1.prototype.pop = function () {
1555
+ if (!this.tail) {
1556
+ return undefined
1557
+ }
1575
1558
 
1576
- Yallist.prototype.shift = function () {
1577
- if (!this.head) {
1578
- return undefined
1579
- }
1559
+ var res = this.tail.value;
1560
+ this.tail = this.tail.prev;
1561
+ if (this.tail) {
1562
+ this.tail.next = null;
1563
+ } else {
1564
+ this.head = null;
1565
+ }
1566
+ this.length--;
1567
+ return res
1568
+ };
1580
1569
 
1581
- var res = this.head.value;
1582
- this.head = this.head.next;
1583
- if (this.head) {
1584
- this.head.prev = null;
1585
- } else {
1586
- this.tail = null;
1587
- }
1588
- this.length--;
1589
- return res
1590
- };
1570
+ Yallist$1.prototype.shift = function () {
1571
+ if (!this.head) {
1572
+ return undefined
1573
+ }
1591
1574
 
1592
- Yallist.prototype.forEach = function (fn, thisp) {
1593
- thisp = thisp || this;
1594
- for (var walker = this.head, i = 0; walker !== null; i++) {
1595
- fn.call(thisp, walker.value, i, this);
1596
- walker = walker.next;
1597
- }
1598
- };
1575
+ var res = this.head.value;
1576
+ this.head = this.head.next;
1577
+ if (this.head) {
1578
+ this.head.prev = null;
1579
+ } else {
1580
+ this.tail = null;
1581
+ }
1582
+ this.length--;
1583
+ return res
1584
+ };
1599
1585
 
1600
- Yallist.prototype.forEachReverse = function (fn, thisp) {
1601
- thisp = thisp || this;
1602
- for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
1603
- fn.call(thisp, walker.value, i, this);
1604
- walker = walker.prev;
1605
- }
1606
- };
1586
+ Yallist$1.prototype.forEach = function (fn, thisp) {
1587
+ thisp = thisp || this;
1588
+ for (var walker = this.head, i = 0; walker !== null; i++) {
1589
+ fn.call(thisp, walker.value, i, this);
1590
+ walker = walker.next;
1591
+ }
1592
+ };
1607
1593
 
1608
- Yallist.prototype.get = function (n) {
1609
- for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
1610
- // abort out of the list early if we hit a cycle
1611
- walker = walker.next;
1612
- }
1613
- if (i === n && walker !== null) {
1614
- return walker.value
1615
- }
1616
- };
1594
+ Yallist$1.prototype.forEachReverse = function (fn, thisp) {
1595
+ thisp = thisp || this;
1596
+ for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
1597
+ fn.call(thisp, walker.value, i, this);
1598
+ walker = walker.prev;
1599
+ }
1600
+ };
1617
1601
 
1618
- Yallist.prototype.getReverse = function (n) {
1619
- for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
1620
- // abort out of the list early if we hit a cycle
1621
- walker = walker.prev;
1622
- }
1623
- if (i === n && walker !== null) {
1624
- return walker.value
1625
- }
1626
- };
1602
+ Yallist$1.prototype.get = function (n) {
1603
+ for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
1604
+ // abort out of the list early if we hit a cycle
1605
+ walker = walker.next;
1606
+ }
1607
+ if (i === n && walker !== null) {
1608
+ return walker.value
1609
+ }
1610
+ };
1627
1611
 
1628
- Yallist.prototype.map = function (fn, thisp) {
1629
- thisp = thisp || this;
1630
- var res = new Yallist();
1631
- for (var walker = this.head; walker !== null;) {
1632
- res.push(fn.call(thisp, walker.value, this));
1633
- walker = walker.next;
1634
- }
1635
- return res
1636
- };
1612
+ Yallist$1.prototype.getReverse = function (n) {
1613
+ for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
1614
+ // abort out of the list early if we hit a cycle
1615
+ walker = walker.prev;
1616
+ }
1617
+ if (i === n && walker !== null) {
1618
+ return walker.value
1619
+ }
1620
+ };
1637
1621
 
1638
- Yallist.prototype.mapReverse = function (fn, thisp) {
1639
- thisp = thisp || this;
1640
- var res = new Yallist();
1641
- for (var walker = this.tail; walker !== null;) {
1642
- res.push(fn.call(thisp, walker.value, this));
1643
- walker = walker.prev;
1644
- }
1645
- return res
1646
- };
1622
+ Yallist$1.prototype.map = function (fn, thisp) {
1623
+ thisp = thisp || this;
1624
+ var res = new Yallist$1();
1625
+ for (var walker = this.head; walker !== null;) {
1626
+ res.push(fn.call(thisp, walker.value, this));
1627
+ walker = walker.next;
1628
+ }
1629
+ return res
1630
+ };
1647
1631
 
1648
- Yallist.prototype.reduce = function (fn, initial) {
1649
- var acc;
1650
- var walker = this.head;
1651
- if (arguments.length > 1) {
1652
- acc = initial;
1653
- } else if (this.head) {
1654
- walker = this.head.next;
1655
- acc = this.head.value;
1656
- } else {
1657
- throw new TypeError('Reduce of empty list with no initial value')
1658
- }
1632
+ Yallist$1.prototype.mapReverse = function (fn, thisp) {
1633
+ thisp = thisp || this;
1634
+ var res = new Yallist$1();
1635
+ for (var walker = this.tail; walker !== null;) {
1636
+ res.push(fn.call(thisp, walker.value, this));
1637
+ walker = walker.prev;
1638
+ }
1639
+ return res
1640
+ };
1659
1641
 
1660
- for (var i = 0; walker !== null; i++) {
1661
- acc = fn(acc, walker.value, i);
1662
- walker = walker.next;
1663
- }
1642
+ Yallist$1.prototype.reduce = function (fn, initial) {
1643
+ var acc;
1644
+ var walker = this.head;
1645
+ if (arguments.length > 1) {
1646
+ acc = initial;
1647
+ } else if (this.head) {
1648
+ walker = this.head.next;
1649
+ acc = this.head.value;
1650
+ } else {
1651
+ throw new TypeError('Reduce of empty list with no initial value')
1652
+ }
1664
1653
 
1665
- return acc
1666
- };
1654
+ for (var i = 0; walker !== null; i++) {
1655
+ acc = fn(acc, walker.value, i);
1656
+ walker = walker.next;
1657
+ }
1667
1658
 
1668
- Yallist.prototype.reduceReverse = function (fn, initial) {
1669
- var acc;
1670
- var walker = this.tail;
1671
- if (arguments.length > 1) {
1672
- acc = initial;
1673
- } else if (this.tail) {
1674
- walker = this.tail.prev;
1675
- acc = this.tail.value;
1676
- } else {
1677
- throw new TypeError('Reduce of empty list with no initial value')
1678
- }
1659
+ return acc
1660
+ };
1679
1661
 
1680
- for (var i = this.length - 1; walker !== null; i--) {
1681
- acc = fn(acc, walker.value, i);
1682
- walker = walker.prev;
1683
- }
1662
+ Yallist$1.prototype.reduceReverse = function (fn, initial) {
1663
+ var acc;
1664
+ var walker = this.tail;
1665
+ if (arguments.length > 1) {
1666
+ acc = initial;
1667
+ } else if (this.tail) {
1668
+ walker = this.tail.prev;
1669
+ acc = this.tail.value;
1670
+ } else {
1671
+ throw new TypeError('Reduce of empty list with no initial value')
1672
+ }
1684
1673
 
1685
- return acc
1686
- };
1674
+ for (var i = this.length - 1; walker !== null; i--) {
1675
+ acc = fn(acc, walker.value, i);
1676
+ walker = walker.prev;
1677
+ }
1687
1678
 
1688
- Yallist.prototype.toArray = function () {
1689
- var arr = new Array(this.length);
1690
- for (var i = 0, walker = this.head; walker !== null; i++) {
1691
- arr[i] = walker.value;
1692
- walker = walker.next;
1693
- }
1694
- return arr
1695
- };
1679
+ return acc
1680
+ };
1696
1681
 
1697
- Yallist.prototype.toArrayReverse = function () {
1698
- var arr = new Array(this.length);
1699
- for (var i = 0, walker = this.tail; walker !== null; i++) {
1700
- arr[i] = walker.value;
1701
- walker = walker.prev;
1702
- }
1703
- return arr
1704
- };
1682
+ Yallist$1.prototype.toArray = function () {
1683
+ var arr = new Array(this.length);
1684
+ for (var i = 0, walker = this.head; walker !== null; i++) {
1685
+ arr[i] = walker.value;
1686
+ walker = walker.next;
1687
+ }
1688
+ return arr
1689
+ };
1705
1690
 
1706
- Yallist.prototype.slice = function (from, to) {
1707
- to = to || this.length;
1708
- if (to < 0) {
1709
- to += this.length;
1710
- }
1711
- from = from || 0;
1712
- if (from < 0) {
1713
- from += this.length;
1714
- }
1715
- var ret = new Yallist();
1716
- if (to < from || to < 0) {
1717
- return ret
1718
- }
1719
- if (from < 0) {
1720
- from = 0;
1721
- }
1722
- if (to > this.length) {
1723
- to = this.length;
1724
- }
1725
- for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
1726
- walker = walker.next;
1727
- }
1728
- for (; walker !== null && i < to; i++, walker = walker.next) {
1729
- ret.push(walker.value);
1730
- }
1731
- return ret
1732
- };
1691
+ Yallist$1.prototype.toArrayReverse = function () {
1692
+ var arr = new Array(this.length);
1693
+ for (var i = 0, walker = this.tail; walker !== null; i++) {
1694
+ arr[i] = walker.value;
1695
+ walker = walker.prev;
1696
+ }
1697
+ return arr
1698
+ };
1733
1699
 
1734
- Yallist.prototype.sliceReverse = function (from, to) {
1735
- to = to || this.length;
1736
- if (to < 0) {
1737
- to += this.length;
1738
- }
1739
- from = from || 0;
1740
- if (from < 0) {
1741
- from += this.length;
1742
- }
1743
- var ret = new Yallist();
1744
- if (to < from || to < 0) {
1745
- return ret
1746
- }
1747
- if (from < 0) {
1748
- from = 0;
1749
- }
1750
- if (to > this.length) {
1751
- to = this.length;
1752
- }
1753
- for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
1754
- walker = walker.prev;
1755
- }
1756
- for (; walker !== null && i > from; i--, walker = walker.prev) {
1757
- ret.push(walker.value);
1758
- }
1759
- return ret
1760
- };
1700
+ Yallist$1.prototype.slice = function (from, to) {
1701
+ to = to || this.length;
1702
+ if (to < 0) {
1703
+ to += this.length;
1704
+ }
1705
+ from = from || 0;
1706
+ if (from < 0) {
1707
+ from += this.length;
1708
+ }
1709
+ var ret = new Yallist$1();
1710
+ if (to < from || to < 0) {
1711
+ return ret
1712
+ }
1713
+ if (from < 0) {
1714
+ from = 0;
1715
+ }
1716
+ if (to > this.length) {
1717
+ to = this.length;
1718
+ }
1719
+ for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
1720
+ walker = walker.next;
1721
+ }
1722
+ for (; walker !== null && i < to; i++, walker = walker.next) {
1723
+ ret.push(walker.value);
1724
+ }
1725
+ return ret
1726
+ };
1761
1727
 
1762
- Yallist.prototype.splice = function (start, deleteCount, ...nodes) {
1763
- if (start > this.length) {
1764
- start = this.length - 1;
1765
- }
1766
- if (start < 0) {
1767
- start = this.length + start;
1768
- }
1728
+ Yallist$1.prototype.sliceReverse = function (from, to) {
1729
+ to = to || this.length;
1730
+ if (to < 0) {
1731
+ to += this.length;
1732
+ }
1733
+ from = from || 0;
1734
+ if (from < 0) {
1735
+ from += this.length;
1736
+ }
1737
+ var ret = new Yallist$1();
1738
+ if (to < from || to < 0) {
1739
+ return ret
1740
+ }
1741
+ if (from < 0) {
1742
+ from = 0;
1743
+ }
1744
+ if (to > this.length) {
1745
+ to = this.length;
1746
+ }
1747
+ for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
1748
+ walker = walker.prev;
1749
+ }
1750
+ for (; walker !== null && i > from; i--, walker = walker.prev) {
1751
+ ret.push(walker.value);
1752
+ }
1753
+ return ret
1754
+ };
1769
1755
 
1770
- for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
1771
- walker = walker.next;
1772
- }
1756
+ Yallist$1.prototype.splice = function (start, deleteCount, ...nodes) {
1757
+ if (start > this.length) {
1758
+ start = this.length - 1;
1759
+ }
1760
+ if (start < 0) {
1761
+ start = this.length + start;
1762
+ }
1773
1763
 
1774
- var ret = [];
1775
- for (var i = 0; walker && i < deleteCount; i++) {
1776
- ret.push(walker.value);
1777
- walker = this.removeNode(walker);
1778
- }
1779
- if (walker === null) {
1780
- walker = this.tail;
1781
- }
1764
+ for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
1765
+ walker = walker.next;
1766
+ }
1782
1767
 
1783
- if (walker !== this.head && walker !== this.tail) {
1784
- walker = walker.prev;
1785
- }
1768
+ var ret = [];
1769
+ for (var i = 0; walker && i < deleteCount; i++) {
1770
+ ret.push(walker.value);
1771
+ walker = this.removeNode(walker);
1772
+ }
1773
+ if (walker === null) {
1774
+ walker = this.tail;
1775
+ }
1786
1776
 
1787
- for (var i = 0; i < nodes.length; i++) {
1788
- walker = insert(this, walker, nodes[i]);
1789
- }
1790
- return ret;
1791
- };
1777
+ if (walker !== this.head && walker !== this.tail) {
1778
+ walker = walker.prev;
1779
+ }
1792
1780
 
1793
- Yallist.prototype.reverse = function () {
1794
- var head = this.head;
1795
- var tail = this.tail;
1796
- for (var walker = head; walker !== null; walker = walker.prev) {
1797
- var p = walker.prev;
1798
- walker.prev = walker.next;
1799
- walker.next = p;
1800
- }
1801
- this.head = tail;
1802
- this.tail = head;
1803
- return this
1804
- };
1781
+ for (var i = 0; i < nodes.length; i++) {
1782
+ walker = insert(this, walker, nodes[i]);
1783
+ }
1784
+ return ret;
1785
+ };
1805
1786
 
1806
- function insert (self, node, value) {
1807
- var inserted = node === self.head ?
1808
- new Node(value, null, node, self) :
1809
- new Node(value, node, node.next, self);
1787
+ Yallist$1.prototype.reverse = function () {
1788
+ var head = this.head;
1789
+ var tail = this.tail;
1790
+ for (var walker = head; walker !== null; walker = walker.prev) {
1791
+ var p = walker.prev;
1792
+ walker.prev = walker.next;
1793
+ walker.next = p;
1794
+ }
1795
+ this.head = tail;
1796
+ this.tail = head;
1797
+ return this
1798
+ };
1810
1799
 
1811
- if (inserted.next === null) {
1812
- self.tail = inserted;
1813
- }
1814
- if (inserted.prev === null) {
1815
- self.head = inserted;
1816
- }
1800
+ function insert (self, node, value) {
1801
+ var inserted = node === self.head ?
1802
+ new Node(value, null, node, self) :
1803
+ new Node(value, node, node.next, self);
1817
1804
 
1818
- self.length++;
1805
+ if (inserted.next === null) {
1806
+ self.tail = inserted;
1807
+ }
1808
+ if (inserted.prev === null) {
1809
+ self.head = inserted;
1810
+ }
1819
1811
 
1820
- return inserted
1821
- }
1812
+ self.length++;
1822
1813
 
1823
- function push (self, item) {
1824
- self.tail = new Node(item, self.tail, null, self);
1825
- if (!self.head) {
1826
- self.head = self.tail;
1827
- }
1828
- self.length++;
1829
- }
1814
+ return inserted
1815
+ }
1830
1816
 
1831
- function unshift (self, item) {
1832
- self.head = new Node(item, null, self.head, self);
1833
- if (!self.tail) {
1834
- self.tail = self.head;
1835
- }
1836
- self.length++;
1837
- }
1817
+ function push (self, item) {
1818
+ self.tail = new Node(item, self.tail, null, self);
1819
+ if (!self.head) {
1820
+ self.head = self.tail;
1821
+ }
1822
+ self.length++;
1823
+ }
1838
1824
 
1839
- function Node (value, prev, next, list) {
1840
- if (!(this instanceof Node)) {
1841
- return new Node(value, prev, next, list)
1842
- }
1825
+ function unshift (self, item) {
1826
+ self.head = new Node(item, null, self.head, self);
1827
+ if (!self.tail) {
1828
+ self.tail = self.head;
1829
+ }
1830
+ self.length++;
1831
+ }
1843
1832
 
1844
- this.list = list;
1845
- this.value = value;
1833
+ function Node (value, prev, next, list) {
1834
+ if (!(this instanceof Node)) {
1835
+ return new Node(value, prev, next, list)
1836
+ }
1846
1837
 
1847
- if (prev) {
1848
- prev.next = this;
1849
- this.prev = prev;
1850
- } else {
1851
- this.prev = null;
1852
- }
1838
+ this.list = list;
1839
+ this.value = value;
1853
1840
 
1854
- if (next) {
1855
- next.prev = this;
1856
- this.next = next;
1857
- } else {
1858
- this.next = null;
1859
- }
1860
- }
1841
+ if (prev) {
1842
+ prev.next = this;
1843
+ this.prev = prev;
1844
+ } else {
1845
+ this.prev = null;
1846
+ }
1861
1847
 
1862
- try {
1863
- // add if support for Symbol.iterator is present
1864
- requireIterator()(Yallist);
1865
- } catch (er) {}
1866
- return yallist;
1848
+ if (next) {
1849
+ next.prev = this;
1850
+ this.next = next;
1851
+ } else {
1852
+ this.next = null;
1853
+ }
1867
1854
  }
1868
1855
 
1869
- var lruCache;
1870
- var hasRequiredLruCache;
1871
-
1872
- function requireLruCache () {
1873
- if (hasRequiredLruCache) return lruCache;
1874
- hasRequiredLruCache = 1;
1875
-
1876
- // A linked list to keep track of recently-used-ness
1877
- const Yallist = requireYallist();
1878
-
1879
- const MAX = Symbol('max');
1880
- const LENGTH = Symbol('length');
1881
- const LENGTH_CALCULATOR = Symbol('lengthCalculator');
1882
- const ALLOW_STALE = Symbol('allowStale');
1883
- const MAX_AGE = Symbol('maxAge');
1884
- const DISPOSE = Symbol('dispose');
1885
- const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
1886
- const LRU_LIST = Symbol('lruList');
1887
- const CACHE = Symbol('cache');
1888
- const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
1889
-
1890
- const naiveLength = () => 1;
1891
-
1892
- // lruList is a yallist where the head is the youngest
1893
- // item, and the tail is the oldest. the list contains the Hit
1894
- // objects as the entries.
1895
- // Each Hit object has a reference to its Yallist.Node. This
1896
- // never changes.
1897
- //
1898
- // cache is a Map (or PseudoMap) that matches the keys to
1899
- // the Yallist.Node object.
1900
- class LRUCache {
1901
- constructor (options) {
1902
- if (typeof options === 'number')
1903
- options = { max: options };
1904
-
1905
- if (!options)
1906
- options = {};
1907
-
1908
- if (options.max && (typeof options.max !== 'number' || options.max < 0))
1909
- throw new TypeError('max must be a non-negative number')
1910
- // Kind of weird to have a default max of Infinity, but oh well.
1911
- this[MAX] = options.max || Infinity;
1912
-
1913
- const lc = options.length || naiveLength;
1914
- this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc;
1915
- this[ALLOW_STALE] = options.stale || false;
1916
- if (options.maxAge && typeof options.maxAge !== 'number')
1917
- throw new TypeError('maxAge must be a number')
1918
- this[MAX_AGE] = options.maxAge || 0;
1919
- this[DISPOSE] = options.dispose;
1920
- this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
1921
- this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
1922
- this.reset();
1923
- }
1856
+ try {
1857
+ // add if support for Symbol.iterator is present
1858
+ requireIterator()(Yallist$1);
1859
+ } catch (er) {}
1860
+
1861
+ // A linked list to keep track of recently-used-ness
1862
+ const Yallist = yallist;
1863
+
1864
+ const MAX = Symbol('max');
1865
+ const LENGTH = Symbol('length');
1866
+ const LENGTH_CALCULATOR = Symbol('lengthCalculator');
1867
+ const ALLOW_STALE = Symbol('allowStale');
1868
+ const MAX_AGE = Symbol('maxAge');
1869
+ const DISPOSE = Symbol('dispose');
1870
+ const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
1871
+ const LRU_LIST = Symbol('lruList');
1872
+ const CACHE = Symbol('cache');
1873
+ const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
1874
+
1875
+ const naiveLength = () => 1;
1876
+
1877
+ // lruList is a yallist where the head is the youngest
1878
+ // item, and the tail is the oldest. the list contains the Hit
1879
+ // objects as the entries.
1880
+ // Each Hit object has a reference to its Yallist.Node. This
1881
+ // never changes.
1882
+ //
1883
+ // cache is a Map (or PseudoMap) that matches the keys to
1884
+ // the Yallist.Node object.
1885
+ class LRUCache {
1886
+ constructor (options) {
1887
+ if (typeof options === 'number')
1888
+ options = { max: options };
1889
+
1890
+ if (!options)
1891
+ options = {};
1892
+
1893
+ if (options.max && (typeof options.max !== 'number' || options.max < 0))
1894
+ throw new TypeError('max must be a non-negative number')
1895
+ // Kind of weird to have a default max of Infinity, but oh well.
1896
+ this[MAX] = options.max || Infinity;
1897
+
1898
+ const lc = options.length || naiveLength;
1899
+ this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc;
1900
+ this[ALLOW_STALE] = options.stale || false;
1901
+ if (options.maxAge && typeof options.maxAge !== 'number')
1902
+ throw new TypeError('maxAge must be a number')
1903
+ this[MAX_AGE] = options.maxAge || 0;
1904
+ this[DISPOSE] = options.dispose;
1905
+ this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
1906
+ this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
1907
+ this.reset();
1908
+ }
1924
1909
 
1925
- // resize the cache when the max changes.
1926
- set max (mL) {
1927
- if (typeof mL !== 'number' || mL < 0)
1928
- throw new TypeError('max must be a non-negative number')
1910
+ // resize the cache when the max changes.
1911
+ set max (mL) {
1912
+ if (typeof mL !== 'number' || mL < 0)
1913
+ throw new TypeError('max must be a non-negative number')
1929
1914
 
1930
- this[MAX] = mL || Infinity;
1931
- trim(this);
1932
- }
1933
- get max () {
1934
- return this[MAX]
1935
- }
1915
+ this[MAX] = mL || Infinity;
1916
+ trim(this);
1917
+ }
1918
+ get max () {
1919
+ return this[MAX]
1920
+ }
1936
1921
 
1937
- set allowStale (allowStale) {
1938
- this[ALLOW_STALE] = !!allowStale;
1939
- }
1940
- get allowStale () {
1941
- return this[ALLOW_STALE]
1942
- }
1922
+ set allowStale (allowStale) {
1923
+ this[ALLOW_STALE] = !!allowStale;
1924
+ }
1925
+ get allowStale () {
1926
+ return this[ALLOW_STALE]
1927
+ }
1943
1928
 
1944
- set maxAge (mA) {
1945
- if (typeof mA !== 'number')
1946
- throw new TypeError('maxAge must be a non-negative number')
1929
+ set maxAge (mA) {
1930
+ if (typeof mA !== 'number')
1931
+ throw new TypeError('maxAge must be a non-negative number')
1947
1932
 
1948
- this[MAX_AGE] = mA;
1949
- trim(this);
1950
- }
1951
- get maxAge () {
1952
- return this[MAX_AGE]
1953
- }
1933
+ this[MAX_AGE] = mA;
1934
+ trim(this);
1935
+ }
1936
+ get maxAge () {
1937
+ return this[MAX_AGE]
1938
+ }
1954
1939
 
1955
- // resize the cache when the lengthCalculator changes.
1956
- set lengthCalculator (lC) {
1957
- if (typeof lC !== 'function')
1958
- lC = naiveLength;
1959
-
1960
- if (lC !== this[LENGTH_CALCULATOR]) {
1961
- this[LENGTH_CALCULATOR] = lC;
1962
- this[LENGTH] = 0;
1963
- this[LRU_LIST].forEach(hit => {
1964
- hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
1965
- this[LENGTH] += hit.length;
1966
- });
1967
- }
1968
- trim(this);
1969
- }
1970
- get lengthCalculator () { return this[LENGTH_CALCULATOR] }
1940
+ // resize the cache when the lengthCalculator changes.
1941
+ set lengthCalculator (lC) {
1942
+ if (typeof lC !== 'function')
1943
+ lC = naiveLength;
1944
+
1945
+ if (lC !== this[LENGTH_CALCULATOR]) {
1946
+ this[LENGTH_CALCULATOR] = lC;
1947
+ this[LENGTH] = 0;
1948
+ this[LRU_LIST].forEach(hit => {
1949
+ hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
1950
+ this[LENGTH] += hit.length;
1951
+ });
1952
+ }
1953
+ trim(this);
1954
+ }
1955
+ get lengthCalculator () { return this[LENGTH_CALCULATOR] }
1971
1956
 
1972
- get length () { return this[LENGTH] }
1973
- get itemCount () { return this[LRU_LIST].length }
1957
+ get length () { return this[LENGTH] }
1958
+ get itemCount () { return this[LRU_LIST].length }
1974
1959
 
1975
- rforEach (fn, thisp) {
1976
- thisp = thisp || this;
1977
- for (let walker = this[LRU_LIST].tail; walker !== null;) {
1978
- const prev = walker.prev;
1979
- forEachStep(this, fn, walker, thisp);
1980
- walker = prev;
1981
- }
1982
- }
1960
+ rforEach (fn, thisp) {
1961
+ thisp = thisp || this;
1962
+ for (let walker = this[LRU_LIST].tail; walker !== null;) {
1963
+ const prev = walker.prev;
1964
+ forEachStep(this, fn, walker, thisp);
1965
+ walker = prev;
1966
+ }
1967
+ }
1983
1968
 
1984
- forEach (fn, thisp) {
1985
- thisp = thisp || this;
1986
- for (let walker = this[LRU_LIST].head; walker !== null;) {
1987
- const next = walker.next;
1988
- forEachStep(this, fn, walker, thisp);
1989
- walker = next;
1990
- }
1991
- }
1969
+ forEach (fn, thisp) {
1970
+ thisp = thisp || this;
1971
+ for (let walker = this[LRU_LIST].head; walker !== null;) {
1972
+ const next = walker.next;
1973
+ forEachStep(this, fn, walker, thisp);
1974
+ walker = next;
1975
+ }
1976
+ }
1992
1977
 
1993
- keys () {
1994
- return this[LRU_LIST].toArray().map(k => k.key)
1995
- }
1978
+ keys () {
1979
+ return this[LRU_LIST].toArray().map(k => k.key)
1980
+ }
1996
1981
 
1997
- values () {
1998
- return this[LRU_LIST].toArray().map(k => k.value)
1999
- }
1982
+ values () {
1983
+ return this[LRU_LIST].toArray().map(k => k.value)
1984
+ }
2000
1985
 
2001
- reset () {
2002
- if (this[DISPOSE] &&
2003
- this[LRU_LIST] &&
2004
- this[LRU_LIST].length) {
2005
- this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));
2006
- }
1986
+ reset () {
1987
+ if (this[DISPOSE] &&
1988
+ this[LRU_LIST] &&
1989
+ this[LRU_LIST].length) {
1990
+ this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));
1991
+ }
2007
1992
 
2008
- this[CACHE] = new Map(); // hash of items by key
2009
- this[LRU_LIST] = new Yallist(); // list of items in order of use recency
2010
- this[LENGTH] = 0; // length of items in the list
2011
- }
1993
+ this[CACHE] = new Map(); // hash of items by key
1994
+ this[LRU_LIST] = new Yallist(); // list of items in order of use recency
1995
+ this[LENGTH] = 0; // length of items in the list
1996
+ }
2012
1997
 
2013
- dump () {
2014
- return this[LRU_LIST].map(hit =>
2015
- isStale(this, hit) ? false : {
2016
- k: hit.key,
2017
- v: hit.value,
2018
- e: hit.now + (hit.maxAge || 0)
2019
- }).toArray().filter(h => h)
2020
- }
1998
+ dump () {
1999
+ return this[LRU_LIST].map(hit =>
2000
+ isStale(this, hit) ? false : {
2001
+ k: hit.key,
2002
+ v: hit.value,
2003
+ e: hit.now + (hit.maxAge || 0)
2004
+ }).toArray().filter(h => h)
2005
+ }
2021
2006
 
2022
- dumpLru () {
2023
- return this[LRU_LIST]
2024
- }
2007
+ dumpLru () {
2008
+ return this[LRU_LIST]
2009
+ }
2025
2010
 
2026
- set (key, value, maxAge) {
2027
- maxAge = maxAge || this[MAX_AGE];
2011
+ set (key, value, maxAge) {
2012
+ maxAge = maxAge || this[MAX_AGE];
2028
2013
 
2029
- if (maxAge && typeof maxAge !== 'number')
2030
- throw new TypeError('maxAge must be a number')
2014
+ if (maxAge && typeof maxAge !== 'number')
2015
+ throw new TypeError('maxAge must be a number')
2031
2016
 
2032
- const now = maxAge ? Date.now() : 0;
2033
- const len = this[LENGTH_CALCULATOR](value, key);
2017
+ const now = maxAge ? Date.now() : 0;
2018
+ const len = this[LENGTH_CALCULATOR](value, key);
2034
2019
 
2035
- if (this[CACHE].has(key)) {
2036
- if (len > this[MAX]) {
2037
- del(this, this[CACHE].get(key));
2038
- return false
2039
- }
2020
+ if (this[CACHE].has(key)) {
2021
+ if (len > this[MAX]) {
2022
+ del(this, this[CACHE].get(key));
2023
+ return false
2024
+ }
2040
2025
 
2041
- const node = this[CACHE].get(key);
2042
- const item = node.value;
2026
+ const node = this[CACHE].get(key);
2027
+ const item = node.value;
2043
2028
 
2044
- // dispose of the old one before overwriting
2045
- // split out into 2 ifs for better coverage tracking
2046
- if (this[DISPOSE]) {
2047
- if (!this[NO_DISPOSE_ON_SET])
2048
- this[DISPOSE](key, item.value);
2049
- }
2029
+ // dispose of the old one before overwriting
2030
+ // split out into 2 ifs for better coverage tracking
2031
+ if (this[DISPOSE]) {
2032
+ if (!this[NO_DISPOSE_ON_SET])
2033
+ this[DISPOSE](key, item.value);
2034
+ }
2050
2035
 
2051
- item.now = now;
2052
- item.maxAge = maxAge;
2053
- item.value = value;
2054
- this[LENGTH] += len - item.length;
2055
- item.length = len;
2056
- this.get(key);
2057
- trim(this);
2058
- return true
2059
- }
2036
+ item.now = now;
2037
+ item.maxAge = maxAge;
2038
+ item.value = value;
2039
+ this[LENGTH] += len - item.length;
2040
+ item.length = len;
2041
+ this.get(key);
2042
+ trim(this);
2043
+ return true
2044
+ }
2060
2045
 
2061
- const hit = new Entry(key, value, len, now, maxAge);
2046
+ const hit = new Entry(key, value, len, now, maxAge);
2062
2047
 
2063
- // oversized objects fall out of cache automatically.
2064
- if (hit.length > this[MAX]) {
2065
- if (this[DISPOSE])
2066
- this[DISPOSE](key, value);
2048
+ // oversized objects fall out of cache automatically.
2049
+ if (hit.length > this[MAX]) {
2050
+ if (this[DISPOSE])
2051
+ this[DISPOSE](key, value);
2067
2052
 
2068
- return false
2069
- }
2053
+ return false
2054
+ }
2070
2055
 
2071
- this[LENGTH] += hit.length;
2072
- this[LRU_LIST].unshift(hit);
2073
- this[CACHE].set(key, this[LRU_LIST].head);
2074
- trim(this);
2075
- return true
2076
- }
2056
+ this[LENGTH] += hit.length;
2057
+ this[LRU_LIST].unshift(hit);
2058
+ this[CACHE].set(key, this[LRU_LIST].head);
2059
+ trim(this);
2060
+ return true
2061
+ }
2077
2062
 
2078
- has (key) {
2079
- if (!this[CACHE].has(key)) return false
2080
- const hit = this[CACHE].get(key).value;
2081
- return !isStale(this, hit)
2082
- }
2063
+ has (key) {
2064
+ if (!this[CACHE].has(key)) return false
2065
+ const hit = this[CACHE].get(key).value;
2066
+ return !isStale(this, hit)
2067
+ }
2083
2068
 
2084
- get (key) {
2085
- return get(this, key, true)
2086
- }
2069
+ get (key) {
2070
+ return get(this, key, true)
2071
+ }
2087
2072
 
2088
- peek (key) {
2089
- return get(this, key, false)
2090
- }
2073
+ peek (key) {
2074
+ return get(this, key, false)
2075
+ }
2091
2076
 
2092
- pop () {
2093
- const node = this[LRU_LIST].tail;
2094
- if (!node)
2095
- return null
2077
+ pop () {
2078
+ const node = this[LRU_LIST].tail;
2079
+ if (!node)
2080
+ return null
2096
2081
 
2097
- del(this, node);
2098
- return node.value
2099
- }
2082
+ del(this, node);
2083
+ return node.value
2084
+ }
2100
2085
 
2101
- del (key) {
2102
- del(this, this[CACHE].get(key));
2103
- }
2086
+ del (key) {
2087
+ del(this, this[CACHE].get(key));
2088
+ }
2104
2089
 
2105
- load (arr) {
2106
- // reset the cache
2107
- this.reset();
2108
-
2109
- const now = Date.now();
2110
- // A previous serialized cache has the most recent items first
2111
- for (let l = arr.length - 1; l >= 0; l--) {
2112
- const hit = arr[l];
2113
- const expiresAt = hit.e || 0;
2114
- if (expiresAt === 0)
2115
- // the item was created without expiration in a non aged cache
2116
- this.set(hit.k, hit.v);
2117
- else {
2118
- const maxAge = expiresAt - now;
2119
- // dont add already expired items
2120
- if (maxAge > 0) {
2121
- this.set(hit.k, hit.v, maxAge);
2122
- }
2123
- }
2124
- }
2125
- }
2090
+ load (arr) {
2091
+ // reset the cache
2092
+ this.reset();
2093
+
2094
+ const now = Date.now();
2095
+ // A previous serialized cache has the most recent items first
2096
+ for (let l = arr.length - 1; l >= 0; l--) {
2097
+ const hit = arr[l];
2098
+ const expiresAt = hit.e || 0;
2099
+ if (expiresAt === 0)
2100
+ // the item was created without expiration in a non aged cache
2101
+ this.set(hit.k, hit.v);
2102
+ else {
2103
+ const maxAge = expiresAt - now;
2104
+ // dont add already expired items
2105
+ if (maxAge > 0) {
2106
+ this.set(hit.k, hit.v, maxAge);
2107
+ }
2108
+ }
2109
+ }
2110
+ }
2126
2111
 
2127
- prune () {
2128
- this[CACHE].forEach((value, key) => get(this, key, false));
2129
- }
2130
- }
2112
+ prune () {
2113
+ this[CACHE].forEach((value, key) => get(this, key, false));
2114
+ }
2115
+ }
2131
2116
 
2132
- const get = (self, key, doUse) => {
2133
- const node = self[CACHE].get(key);
2134
- if (node) {
2135
- const hit = node.value;
2136
- if (isStale(self, hit)) {
2137
- del(self, node);
2138
- if (!self[ALLOW_STALE])
2139
- return undefined
2140
- } else {
2141
- if (doUse) {
2142
- if (self[UPDATE_AGE_ON_GET])
2143
- node.value.now = Date.now();
2144
- self[LRU_LIST].unshiftNode(node);
2145
- }
2146
- }
2147
- return hit.value
2148
- }
2149
- };
2117
+ const get = (self, key, doUse) => {
2118
+ const node = self[CACHE].get(key);
2119
+ if (node) {
2120
+ const hit = node.value;
2121
+ if (isStale(self, hit)) {
2122
+ del(self, node);
2123
+ if (!self[ALLOW_STALE])
2124
+ return undefined
2125
+ } else {
2126
+ if (doUse) {
2127
+ if (self[UPDATE_AGE_ON_GET])
2128
+ node.value.now = Date.now();
2129
+ self[LRU_LIST].unshiftNode(node);
2130
+ }
2131
+ }
2132
+ return hit.value
2133
+ }
2134
+ };
2150
2135
 
2151
- const isStale = (self, hit) => {
2152
- if (!hit || (!hit.maxAge && !self[MAX_AGE]))
2153
- return false
2136
+ const isStale = (self, hit) => {
2137
+ if (!hit || (!hit.maxAge && !self[MAX_AGE]))
2138
+ return false
2154
2139
 
2155
- const diff = Date.now() - hit.now;
2156
- return hit.maxAge ? diff > hit.maxAge
2157
- : self[MAX_AGE] && (diff > self[MAX_AGE])
2158
- };
2140
+ const diff = Date.now() - hit.now;
2141
+ return hit.maxAge ? diff > hit.maxAge
2142
+ : self[MAX_AGE] && (diff > self[MAX_AGE])
2143
+ };
2159
2144
 
2160
- const trim = self => {
2161
- if (self[LENGTH] > self[MAX]) {
2162
- for (let walker = self[LRU_LIST].tail;
2163
- self[LENGTH] > self[MAX] && walker !== null;) {
2164
- // We know that we're about to delete this one, and also
2165
- // what the next least recently used key will be, so just
2166
- // go ahead and set it now.
2167
- const prev = walker.prev;
2168
- del(self, walker);
2169
- walker = prev;
2170
- }
2171
- }
2172
- };
2145
+ const trim = self => {
2146
+ if (self[LENGTH] > self[MAX]) {
2147
+ for (let walker = self[LRU_LIST].tail;
2148
+ self[LENGTH] > self[MAX] && walker !== null;) {
2149
+ // We know that we're about to delete this one, and also
2150
+ // what the next least recently used key will be, so just
2151
+ // go ahead and set it now.
2152
+ const prev = walker.prev;
2153
+ del(self, walker);
2154
+ walker = prev;
2155
+ }
2156
+ }
2157
+ };
2173
2158
 
2174
- const del = (self, node) => {
2175
- if (node) {
2176
- const hit = node.value;
2177
- if (self[DISPOSE])
2178
- self[DISPOSE](hit.key, hit.value);
2159
+ const del = (self, node) => {
2160
+ if (node) {
2161
+ const hit = node.value;
2162
+ if (self[DISPOSE])
2163
+ self[DISPOSE](hit.key, hit.value);
2179
2164
 
2180
- self[LENGTH] -= hit.length;
2181
- self[CACHE].delete(hit.key);
2182
- self[LRU_LIST].removeNode(node);
2183
- }
2184
- };
2165
+ self[LENGTH] -= hit.length;
2166
+ self[CACHE].delete(hit.key);
2167
+ self[LRU_LIST].removeNode(node);
2168
+ }
2169
+ };
2185
2170
 
2186
- class Entry {
2187
- constructor (key, value, length, now, maxAge) {
2188
- this.key = key;
2189
- this.value = value;
2190
- this.length = length;
2191
- this.now = now;
2192
- this.maxAge = maxAge || 0;
2193
- }
2194
- }
2171
+ class Entry {
2172
+ constructor (key, value, length, now, maxAge) {
2173
+ this.key = key;
2174
+ this.value = value;
2175
+ this.length = length;
2176
+ this.now = now;
2177
+ this.maxAge = maxAge || 0;
2178
+ }
2179
+ }
2195
2180
 
2196
- const forEachStep = (self, fn, node, thisp) => {
2197
- let hit = node.value;
2198
- if (isStale(self, hit)) {
2199
- del(self, node);
2200
- if (!self[ALLOW_STALE])
2201
- hit = undefined;
2202
- }
2203
- if (hit)
2204
- fn.call(thisp, hit.value, hit.key, self);
2205
- };
2181
+ const forEachStep = (self, fn, node, thisp) => {
2182
+ let hit = node.value;
2183
+ if (isStale(self, hit)) {
2184
+ del(self, node);
2185
+ if (!self[ALLOW_STALE])
2186
+ hit = undefined;
2187
+ }
2188
+ if (hit)
2189
+ fn.call(thisp, hit.value, hit.key, self);
2190
+ };
2206
2191
 
2207
- lruCache = LRUCache;
2208
- return lruCache;
2209
- }
2192
+ var lruCache = LRUCache;
2210
2193
 
2211
2194
  var range;
2212
2195
  var hasRequiredRange;
@@ -2414,7 +2397,7 @@ function requireRange () {
2414
2397
 
2415
2398
  range = Range;
2416
2399
 
2417
- const LRU = requireLruCache();
2400
+ const LRU = lruCache;
2418
2401
  const cache = new LRU({ max: 1000 });
2419
2402
 
2420
2403
  const parseOptions = parseOptions_1;