rate-limit-mongo icon indicating copy to clipboard operation
rate-limit-mongo copied to clipboard

Use new `Store` interface from `express-rate-limit` v6

Open gamemaker1 opened this issue 3 years ago • 4 comments

Hi @okv,

I recently helped out with a Typescript rewrite for the express-rate-limit package, which also introduced a couple of changes to the Store interface:

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:

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:

  1. Rewrite the library in Typescript, OR
  2. Add a type definition file (index.d.ts like what @gtmsingh has suggested in https://github.com/2do2go/rate-limit-mongo/issues/27#issuecomment-855444547) 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

gamemaker1 avatar Jan 18 '22 10:01 gamemaker1

Hey @gamemaker1, to be honest I'm not a big TypeScript fan. But everything except it sounds awesome :smiley: 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.

okv avatar Jan 19 '22 18:01 okv

Great, I'll start working on a PR this weekend! I'll also take a look at #28.

gamemaker1 avatar Jan 20 '22 01:01 gamemaker1

Is this issue stale? Not to necrobump but it would be nice to support v6 👍

FxllenCode avatar Sep 22 '22 20:09 FxllenCode

@FxllenCode yes, this issue is stale since I have not gotten the time to convert the store to by yet :(

Although ypu could send in a PR as per the discussion above.

gamemaker1 avatar Sep 23 '22 02:09 gamemaker1