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.
Hey @gamemaker1, to be honest I'm not a big TypeScript fan. But everything except it sounds awesome 😃
I would keep the code in JS, but index.d.ts could be useful. Any assistance with reviewing #28 is highly appreciated.
I will try to take a closer look at all this next weekend.
Hi @okv,
I recently helped out with a Typescript rewrite for the
express-rate-limit
package, which also introduced a couple of changes to theStore
interface:init
method for stores to set themselves up using options passed to the middleware.incr
method toincrement
.increment
,decrement
,resetKey
andresetAll
methods 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 newerStore
interface allows for the following:expireTimeMs
/windowMs
twice (once to the middleware and once to the store) with the introduction of theinit
method.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: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.Please let me know your thoughts on the above.
Thanks,
Vedant
// cc @nfriedly
The text was updated successfully, but these errors were encountered: