Fixed cache save to db
Some checks failed
Build / Build NPM Project (push) Successful in 43s
Build / Publish Documentation (push) Failing after 5s
Build / Tag Version (push) Successful in 8s

This commit is contained in:
2025-07-07 15:27:07 -04:00
parent ce3878e18b
commit 71552aa243
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -80,7 +80,7 @@ export class Cache<K extends string | number | symbol, T> {
if(persists.storage?.constructor.name == 'Database') {
(<Database>persists.storage).createTable({name: persists.key, key: <string>this.key}).then(table => {
if(key) {
table.set(key, this.get(key));
table.set(this.get(key), key);
} else {
table.clear();
this.all().forEach(row => table.add(row));