From 6ee7b2767e4864f6b9e421ccac01876b51c26515 Mon Sep 17 00:00:00 2001 From: Kuitos Date: Sun, 2 Oct 2022 10:32:02 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=20upgrade=20type=20assert=20(#92)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/isCacheLike.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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'; }