onur-ozkan / nestjs-rate-limiter

Highly configurable and extensible rate limiter library
https://npmjs.com/package/nestjs-rate-limiter
MIT License
238 stars 43 forks source link

Unit Test Support #34

Closed shannonlal closed 3 years ago

shannonlal commented 3 years ago

I have been recently playing around with this library and I was really impressed with how it works. I am looking at starting to introduce this with my company. I was looking through the TODO list and I noticed that you were looking to improve the unit tests. I would be willing to help out if you would be willing to accept PRs. One of the things I saw was that the class rate-limiter.interceptor.ts was a little bit long (specifically the function getRateLimiter). I was thinking this could be refactored into a series of smaller functions (i.e. one per type (Memory, Redis, etc). If you think there are other areas that you could use help let me know (I have committed on a couple of open source projects in the past).

onur-ozkan commented 3 years ago

These days I focused on some new features instead of unit tests and cd & ci. But the other thing that you are saying about interceptor, yes that's definitely true. I am not the one who started this project, I took this project about 2-3 months ago, and during that time I did my best to make this library better. This month I have been working really hard on some other projects and I couldn't take a look at this project but refactoring the whole project code is also on my workplan.

shannonlal commented 3 years ago

@ozkanonur Thanks for accepting this PR. I will create another ticket for some of the refactoring of the rate interceptor. Thanks again