chore: upgrade eslint, babel, and prettier (#12393)

This commit is contained in:
Jesse Yang
2021-01-10 17:26:35 -08:00
committed by GitHub
parent 6bee3a0581
commit 9acf48fd1e
69 changed files with 4563 additions and 1964 deletions

View File

@@ -21,14 +21,12 @@ export const cacheWrapper = <T extends Array<any>, U>(
fn: (...args: T) => U,
cache: Map<string, any>,
keyFn: (...args: T) => string = (...args: T) => JSON.stringify([...args]),
) => {
return (...args: T): U => {
const key = keyFn(...args);
if (cache.has(key)) {
return cache.get(key);
}
const result = fn(...args);
cache.set(key, result);
return result;
};
) => (...args: T): U => {
const key = keyFn(...args);
if (cache.has(key)) {
return cache.get(key);
}
const result = fn(...args);
cache.set(key, result);
return result;
};