@ztimson/utils 0.24.10 → 0.24.12

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
@@ -493,7 +493,7 @@ ${opts.message || this.desc}`;
493
493
  * @return {[K, T][]} Key-value pairs array
494
494
  */
495
495
  entries(expired) {
496
- return deepCopy(Object.entries(this.store).filter((v) => expired || !v._expired));
496
+ return deepCopy(Object.entries(this.store).filter((v) => expired || !(v == null ? void 0 : v._expired)));
497
497
  }
498
498
  /**
499
499
  * Manually expire a cached item
@@ -511,7 +511,7 @@ ${opts.message || this.desc}`;
511
511
  */
512
512
  get(key, expired) {
513
513
  const cached = deepCopy(this.store[key] ?? null);
514
- if (expired || !cached._expired) return cached;
514
+ if (expired || !(cached == null ? void 0 : cached._expired)) return cached;
515
515
  return null;
516
516
  }
517
517
  /**
@@ -540,7 +540,7 @@ ${opts.message || this.desc}`;
540
540
  * @return {this}
541
541
  */
542
542
  set(key, value, ttl = this.options.ttl) {
543
- if (this.options.expiryPolicy == "keep") delete this.store[key]._expired;
543
+ if (this.options.expiryPolicy == "keep") delete value._expired;
544
544
  this.store[key] = value;
545
545
  this.save();
546
546
  if (ttl) setTimeout(() => {