We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64eaa89 commit 6ee7b27Copy full SHA for 6ee7b27
src/utils/isCacheLike.ts
@@ -3,8 +3,8 @@
3
* @homepage https://github.com/kuitos/
4
* @since 2018-03-19
5
*/
6
+import { ICacheLike } from './getDefaultLruCache';
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');
+export default function isCacheLike(cache: any): cache is ICacheLike<any> {
+ return typeof cache.get === 'function' && typeof cache.set === 'function' && typeof cache.del === 'function';
10
}
0 commit comments