@ztimson/utils 0.25.24 → 0.25.25
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/index.cjs +6 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -759,17 +759,16 @@ class Cache {
|
|
|
759
759
|
if (this.options.storage) {
|
|
760
760
|
if (this.options.storage instanceof Table) {
|
|
761
761
|
if (key == null) {
|
|
762
|
-
|
|
762
|
+
let rows = this.entries();
|
|
763
763
|
rows.forEach(([k, v]) => {
|
|
764
764
|
var _a;
|
|
765
765
|
return (_a = this.options.storage) == null ? void 0 : _a.put(k, v);
|
|
766
766
|
});
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
});
|
|
767
|
+
rows = rows.map(([k]) => k);
|
|
768
|
+
this.options.storage.getAllKeys().then((keys) => keys.filter((k) => !rows.includes(k)).forEach((k) => {
|
|
769
|
+
var _a;
|
|
770
|
+
return (_a = this.options.storage) == null ? void 0 : _a.delete(k);
|
|
771
|
+
}));
|
|
773
772
|
} else if (this.store[key] === void 0) this.options.storage.delete(key);
|
|
774
773
|
else this.options.storage.put(key, this.store[key]);
|
|
775
774
|
} else if (this.options.storageKey) {
|