got
got copied to clipboard
quick-lru not a valid StorageAdapter
Describe the bug
- Node.js version: 14.16.0
- OS & version: -
Actual behavior
It seems that since https://github.com/sindresorhus/quick-lru/releases/tag/v6.0.0 quick-lru is not compatible anymore with keyv:
Type 'QuickLRU<unknown, unknown>' is not assignable to type 'string | false | StorageAdapter | undefined'.
Type 'QuickLRU<unknown, unknown>' is not assignable to type 'StorageAdapter'.
Types of property 'set' are incompatible.
Type '(key: unknown, value: unknown, options?: { maxAge?: number | undefined; } | undefined) => QuickLRU<unknown, unknown>' is not assignable to type '(key: string, value: any, ttl?: number | undefined) => any'.
Types of parameters 'options' and 'ttl' are incompatible.
Type 'number | undefined' is not assignable to type '{ maxAge?: number | undefined; } | undefined'.
Type 'number' is not assignable to type '{ maxAge?: number | undefined; } | undefined'.
Expected behavior
Either
1- Change signature of quicklru .set
so that the metod is compliant with keyv StorageAdapter
interface
2- Remove suggestion of quick-lru usage inside the readme
Checklist
- [x] I have read the documentation.
- [x] I have tried my code with the latest version of Node.js and Got.
For now, we can update the readme to specify that v5 needs to be used.
I think the proper solution is to make keyv
detect QuickLRU
instance and pass the ttl
correctly.
Is this still an issue with https://github.com/microlinkhq/keyv? If not, why don’t we recommend it instead of keyv
?
For now, we can update the readme to specify that v5 needs to be used.
I think the proper solution is to make
keyv
detectQuickLRU
instance and pass thettl
correctly.
Isn't it going to be handled? I mean, the version now is v14
. Downgrade to v5
cannot be acceptable..