You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the external tests show, the store still works (without any changes) with v6 of express-rate-limit. However, implementing the newer Store interface allows for the following:
Since all functions can now return Promises, it removes the need for the numerous callbacks used in the code.
I would be happy to open/help out with a PR that implements the new Store interface.
Also, I see that #27 is still open and there is no @types/rate-limit-mongo package. Would you like this PR to also:
Rewrite the library in Typescript, OR
Add a type definition file (index.d.ts like what @gtmsingh has suggested in Typescript declaration #27 (comment)) so that Typescript users don't encounter errors while using this library.
Hi @okv,
I recently helped out with a Typescript rewrite for the
express-rate-limitpackage, which also introduced a couple of changes to theStoreinterface:initmethod for stores to set themselves up using options passed to the middleware.incrmethod toincrement.increment,decrement,resetKeyandresetAllmethods to return a promise.As the external tests show, the store still works (without any changes) with v6 of
express-rate-limit. However, implementing the newerStoreinterface allows for the following:expireTimeMs/windowMstwice (once to the middleware and once to the store) with the introduction of theinitmethod.I would be happy to open/help out with a PR that implements the new
Storeinterface.Also, I see that #27 is still open and there is no
@types/rate-limit-mongopackage. Would you like this PR to also:index.d.tslike what @gtmsingh has suggested in Typescript declaration #27 (comment)) so that Typescript users don't encounter errors while using this library.Please let me know your thoughts on the above.
Thanks,
Vedant
// cc @nfriedly