Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
cf122ef9e8 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ztimson/utils",
|
||||
"version": "0.24.11",
|
||||
"version": "0.24.12",
|
||||
"description": "Utility library",
|
||||
"author": "Zak Timson",
|
||||
"license": "MIT",
|
||||
|
@ -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(() => {
|
||||
|
Reference in New Issue
Block a user