Added size getter for cache
All checks were successful
Build / Build NPM Project (push) Successful in 1m7s
Build / Publish Docs (push) Successful in 1m7s
Build / Tag Version (push) Successful in 13s

This commit is contained in:
2026-07-24 21:56:08 -04:00
parent fbe46ddb64
commit f9971d7ce1
2 changed files with 3 additions and 1 deletions

View File

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

View File

@@ -31,6 +31,8 @@ export class Cache<K extends string | number | symbol, T> {
/** Await initial loading */
loading = new Promise<void>(r => this._loading = r);
get size() { return this.store.size; }
/**
* Create new cache
* @param {keyof T} key Default property to use as primary key