* Fixed cache expiry
All checks were successful
Build / Build NPM Project (push) Successful in 46s
Build / Tag Version (push) Successful in 8s
Build / Publish Documentation (push) Successful in 34s

This commit is contained in:
Zakary Timson 2025-05-13 11:13:48 -04:00
parent 76b570b3fe
commit cf122ef9e8
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@ztimson/utils",
"version": "0.24.11",
"version": "0.24.12",
"description": "Utility library",
"author": "Zak Timson",
"license": "MIT",

View File

@ -172,7 +172,7 @@ export class Cache<K extends string | number | symbol, T> {
* @return {this}
*/
set(key: K, value: T, ttl = this.options.ttl): this {
if(this.options.expiryPolicy == 'keep') delete (<any>this.store[key])._expired;
if(this.options.expiryPolicy == 'keep') delete (<any>value)._expired;
this.store[key] = value;
this.save();
if(ttl) setTimeout(() => {