@ztimson/utils 0.24.9 → 0.24.11

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/cache.d.ts CHANGED
@@ -8,7 +8,7 @@ export type CacheOptions = {
8
8
  /** Keep or delete cached items once expired, defaults to delete */
9
9
  expiryPolicy?: 'delete' | 'keep';
10
10
  };
11
- export type CachedValue<T> = T | {
11
+ export type CachedValue<T> = T & {
12
12
  _expired?: boolean;
13
13
  };
14
14
  /**
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
  /**