Skip to content

Commit 6ee7b27

Browse files
authored
🏷 upgrade type assert (#92)
1 parent 64eaa89 commit 6ee7b27

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/isCacheLike.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* @homepage https://github.com/kuitos/
44
* @since 2018-03-19
55
*/
6+
import { ICacheLike } from './getDefaultLruCache';
67

7-
export default function isCacheLike(cache: any) {
8-
return !!(cache.set && cache.get && cache.del &&
9-
typeof cache.get === 'function' && typeof cache.set === 'function' && typeof cache.del === 'function');
8+
export default function isCacheLike(cache: any): cache is ICacheLike<any> {
9+
return typeof cache.get === 'function' && typeof cache.set === 'function' && typeof cache.del === 'function';
1010
}

0 commit comments

Comments
 (0)