mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
[@types/memoizee] More accurate types for normalizer option (#38060)
* Improve typings for `normalizer` memoizee option * Fix build * Fix test
This commit is contained in:
Vendored
+1
-1
@@ -13,7 +13,7 @@ declare namespace memoizee {
|
||||
dispose?(value: any): void;
|
||||
async?: boolean;
|
||||
primitive?: boolean;
|
||||
normalizer?(value: any): void;
|
||||
normalizer?(args: any[]): string;
|
||||
resolvers?: Array<(arg: any) => any>;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ memoized.clear('bar', 7); // Dispose called with bar7 value
|
||||
memoized.delete('foo', 0);
|
||||
const mFn = memoize((hash: any) => {
|
||||
// body of memoized function
|
||||
}, { normalizer: (args: any) => {
|
||||
}, { normalizer: (args: any[]) => {
|
||||
// args is arguments object as accessible in memoized function
|
||||
return JSON.stringify(args[0]);
|
||||
} });
|
||||
|
||||
Reference in New Issue
Block a user