Make the storage
field in the ThrottlerStorage
interface optional
#1221
Labels
bug
Something isn't working
storage
field in the ThrottlerStorage
interface optional
#1221
Is there an existing issue for this?
Current behavior
Currently the
storage
field in theThrottlerStorage
interface is required:throttler/src/throttler-storage.interface.ts
Lines 1 to 8 in 92cd4eb
This makes sense for the in memory cache, but I have built my own Redis storage service which implements the
ThrottlerStorage
interface and I have no use for thestorage
field from what I can tell.It would be nice if this field was deemed optional so I don't have unused code sitting in my
ThrottlerRedisStorageService
which implementsThrottlerStorage
.I am happy to make a PR for this fix, but I just wanted to confirm this field is indeed optional when using your own storage option.
Minimum reproduction code
See 'Steps to reproduce'.
Steps to reproduce
Expected behavior
As far as I know, I do not require the
storage
field, so would prefer it to be optional to save an unused line of code.Package version
3.1.0
NestJS version
9.1.4
Node.js version
16.18.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: