Adjust cache type to be Map independent
This commit is contained in:
+7
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user