diff --git a/src/utils/isCacheLike.ts b/src/utils/isCacheLike.ts index 9ef87fc..81a6fd5 100644 --- a/src/utils/isCacheLike.ts +++ b/src/utils/isCacheLike.ts @@ -3,8 +3,8 @@ * @homepage https://github.com/kuitos/ * @since 2018-03-19 */ +import { ICacheLike } from './getDefaultLruCache'; -export default function isCacheLike(cache: any) { - return !!(cache.set && cache.get && cache.del && - typeof cache.get === 'function' && typeof cache.set === 'function' && typeof cache.del === 'function'); +export default function isCacheLike(cache: any): cache is ICacheLike { + return typeof cache.get === 'function' && typeof cache.set === 'function' && typeof cache.del === 'function'; }