Adjust cache type to be Map independent

This commit is contained in:
Schluffe
2026-08-08 14:10:59 +02:00
parent bed4a58cad
commit 320c867d8d
+7 -1
View File
@@ -1,4 +1,10 @@
export type Cache<T> = Map<unknown, T>;
export type Cache<T> = {
clear(): void;
delete(key: unknown): boolean;
get(key: unknown): T | undefined;
has(key: unknown): boolean;
set(key: unknown, value: T): unknown;
};
export function withCache<T, U extends (...args: Parameters<U>) => T>(
fn: U,