diff --git a/README.md b/README.md index 1e746fd..26b2b1d 100755 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ export default function buildMemoizer( fn: unknown>( fn: FN, opt?: Partial - ) => Promise<(...args: Parameters) => EnsurePromise>> + ) => Promise<(...args: Parameters) => Promise>>> getCacheFilePath: ( fn: (...args: never) => unknown, args: unknown[], @@ -164,8 +164,6 @@ export default function buildMemoizer( ) => string invalidate: (cacheId?: string) => Promise } - -type EnsurePromise = T extends PromiseLike ? T : Promise; ``` ## Options diff --git a/src/index.ts b/src/index.ts index 0177c99..e278572 100644 --- a/src/index.ts +++ b/src/index.ts @@ -405,11 +405,9 @@ export default function buildMemoizer( await initCache(memoizerOptions.cachePath || '') return memoizeFn(fn as never, opt) as unknown as ( ...args: Parameters - ) => EnsurePromise> + ) => Promise>> }, getCacheFilePath: getCacheFilePathBound, invalidate: invalidateCache, } } - -type EnsurePromise = T extends PromiseLike ? T : Promise;