Skip to content

Commit 80d7eb3

Browse files
authored
🩹 compatible with lru-cache v7 (#93)
1 parent 6ee7b27 commit 80d7eb3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,22 @@
44
* @since 2017-09-28
55
*/
66

7-
import Cache from 'lru-cache';
7+
import LRUCache from 'lru-cache';
88
import cacheAdapterEnhancer from './cacheAdapterEnhancer';
99
import retryAdapterEnhancer from './retryAdapterEnhancer';
1010
import throttleAdapterEnhancer from './throttleAdapterEnhancer';
1111
import { ICacheLike } from './utils/getDefaultLruCache';
1212

13+
class Cache<K, V> extends LRUCache<K, V> {
14+
constructor(options: LRUCache.Options<any, any>) {
15+
super(options);
16+
}
17+
18+
del(key: K): boolean {
19+
return super.delete(key);
20+
}
21+
}
22+
1323
export {
1424
Cache,
1525
ICacheLike,

0 commit comments

Comments
 (0)