Skip to content

Commit

Permalink
🏷 upgrade type assert (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos authored Oct 2, 2022
1 parent 64eaa89 commit 6ee7b27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/isCacheLike.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any> {
return typeof cache.get === 'function' && typeof cache.set === 'function' && typeof cache.del === 'function';
}

0 comments on commit 6ee7b27

Please sign in to comment.