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