Added clear function to cache
All checks were successful
Build / Build NPM Project (push) Successful in 37s
Build / Tag Version (push) Successful in 7s
Build / Publish Documentation (push) Successful in 35s

This commit is contained in:
Zakary Timson 2024-10-14 21:07:59 -04:00
parent 0f10aebfd2
commit b21f462d35
2 changed files with 8 additions and 1 deletions

View File

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

View File

@ -87,6 +87,13 @@ export class Cache<K extends string | number | symbol, T> {
return this;
}
/**
* Remove all keys from cache
*/
clear() {
this.store = <Record<K, T>>{};
}
/**
* Delete an item from the cache
*