@ztimson/utils 0.25.26 → 0.25.27

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.mjs CHANGED
@@ -718,7 +718,7 @@ class Cache {
718
718
  * @return {T[]} Array of items
719
719
  */
720
720
  __publicField(this, "values", this.all());
721
- var _a;
721
+ var _a, _b, _c, _d;
722
722
  this.key = key;
723
723
  this.options = options;
724
724
  let done;
@@ -726,7 +726,7 @@ class Cache {
726
726
  if (this.options.persistentStorage != null) {
727
727
  if (typeof this.options.persistentStorage == "string")
728
728
  this.options.persistentStorage = { storage: localStorage, key: this.options.persistentStorage };
729
- if (((_a = this.options.persistentStorage) == null ? void 0 : _a.storage) instanceof Database) {
729
+ if (((_b = (_a = this.options.persistentStorage) == null ? void 0 : _a.storage) == null ? void 0 : _b.constructor.name) == "Database") {
730
730
  (async () => {
731
731
  const persists = this.options.persistentStorage;
732
732
  const table = await persists.storage.createTable({ name: persists.key, key: this.key });
@@ -734,7 +734,7 @@ class Cache {
734
734
  Object.assign(this.store, rows.reduce((acc, row) => ({ ...acc, [this.getKey(row)]: row }), {}));
735
735
  done();
736
736
  })();
737
- } else {
737
+ } else if (((_d = (_c = this.options.persistentStorage) == null ? void 0 : _c.storage) == null ? void 0 : _d.constructor.name) == "Storage") {
738
738
  const stored = this.options.persistentStorage.storage.getItem(this.options.persistentStorage.key);
739
739
  if (stored != null) try {
740
740
  Object.assign(this.store, JSON.parse(stored));