Skip to content

Commit

Permalink
refactor: refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu committed Jan 3, 2025
1 parent 6df6648 commit 3be56df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/memoize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export function memoizeFactory({
calcHash = calcHashWithContext,
maxCachedArgsSize = 100,
}: {
maxCachedArgsSize?: number;
cacheDuration?: number;
calcHash?: (self: unknown, args: unknown[]) => string;
caches?: Map<string, [unknown, number]>[];
calcHash?: (self: unknown, args: unknown[]) => string;
maxCachedArgsSize?: number;
} = {}) {
return function memoize<This, Args extends unknown[], Return>(
target: ((this: This, ...args: Args) => Return) | ((...args: Args) => Return) | keyof This,
Expand Down
6 changes: 3 additions & 3 deletions src/memoizeWithPersistentCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export function memoizeWithPersistentCacheFactory({
removeCache,
tryReadingCache,
}: {
maxCachedArgsSize?: number;
cacheDuration?: number;
calcHash?: (self: unknown, args: unknown) => string;
caches?: Map<string, [unknown, number]>[];
calcHash?: (self: unknown, args: unknown) => string;
maxCachedArgsSize?: number;
persistCache: (persistentKey: string, hash: string, currentTime: number, value: unknown) => void;
tryReadingCache: (persistentKey: string, hash: string) => [number, unknown] | undefined;
removeCache: (persistentKey: string, hash: string) => void;
tryReadingCache: (persistentKey: string, hash: string) => [number, unknown] | undefined;
}) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return function <This, Args extends any[], Return>(
Expand Down

0 comments on commit 3be56df

Please sign in to comment.