@flowgram.ai/utils 0.1.0-alpha.8 → 0.1.0-alpha.9
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.
- package/dist/esm/index.js +5 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +5 -8
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/esm/index.js
CHANGED
|
@@ -1717,7 +1717,6 @@ var Cache;
|
|
|
1717
1717
|
return cache;
|
|
1718
1718
|
},
|
|
1719
1719
|
getMore(count, autoDelete = true) {
|
|
1720
|
-
var _a;
|
|
1721
1720
|
if (count === cache.length) {
|
|
1722
1721
|
} else if (count > cache.length) {
|
|
1723
1722
|
let added = count - cache.length;
|
|
@@ -1726,7 +1725,7 @@ var Cache;
|
|
|
1726
1725
|
added--;
|
|
1727
1726
|
}
|
|
1728
1727
|
} else if (autoDelete) {
|
|
1729
|
-
const deleteLimit =
|
|
1728
|
+
const deleteLimit = opts.deleteLimit ?? 0;
|
|
1730
1729
|
if (cache.length - count > deleteLimit) {
|
|
1731
1730
|
const deleted = cache.splice(count);
|
|
1732
1731
|
deleted.forEach((el) => el.dispose && el.dispose());
|
|
@@ -1742,12 +1741,11 @@ var Cache;
|
|
|
1742
1741
|
const newCache = [];
|
|
1743
1742
|
const findedMap = /* @__PURE__ */ new Map();
|
|
1744
1743
|
cache.forEach((item) => {
|
|
1745
|
-
var _a;
|
|
1746
1744
|
const finded = items.find((i) => i.key === item.key);
|
|
1747
1745
|
if (finded) {
|
|
1748
1746
|
findedMap.set(item.key, item);
|
|
1749
1747
|
} else {
|
|
1750
|
-
|
|
1748
|
+
item.dispose?.();
|
|
1751
1749
|
}
|
|
1752
1750
|
});
|
|
1753
1751
|
items.forEach((item) => {
|
|
@@ -1769,12 +1767,11 @@ var Cache;
|
|
|
1769
1767
|
const newCache = [];
|
|
1770
1768
|
const findedMap = /* @__PURE__ */ new Map();
|
|
1771
1769
|
cache.forEach((cacheItem) => {
|
|
1772
|
-
var _a;
|
|
1773
1770
|
const finded = items.find((ref) => ref === cacheItem.key);
|
|
1774
1771
|
if (finded) {
|
|
1775
1772
|
findedMap.set(cacheItem.key, cacheItem);
|
|
1776
1773
|
} else {
|
|
1777
|
-
|
|
1774
|
+
cacheItem.dispose?.();
|
|
1778
1775
|
}
|
|
1779
1776
|
});
|
|
1780
1777
|
items.forEach((item) => {
|
|
@@ -1854,11 +1851,11 @@ var SchemaDecoration;
|
|
|
1854
1851
|
return {
|
|
1855
1852
|
type: "object",
|
|
1856
1853
|
properties: {
|
|
1857
|
-
...baseDecoration
|
|
1854
|
+
...baseDecoration?.properties,
|
|
1858
1855
|
...properties
|
|
1859
1856
|
},
|
|
1860
1857
|
mixinDefaults: {
|
|
1861
|
-
...baseDecoration
|
|
1858
|
+
...baseDecoration?.mixinDefaults,
|
|
1862
1859
|
...mixinDefaults
|
|
1863
1860
|
}
|
|
1864
1861
|
};
|