This update allows timeWindow to be a function that can dynamically determine the time window based on the request and key. The code refactor has been applied across both the Redis and Local stores. Tests for this new functionality have been added to ensure correctness. The TypeScript definition was also updated to reflect this change.
This update allows
timeWindow
to be a function that can dynamically determine the time window based on the request and key. The code refactor has been applied across both the Redis and Local stores. Tests for this new functionality have been added to ensure correctness. The TypeScript definition was also updated to reflect this change.https://github.com/fastify/fastify-rate-limit/issues/283
Checklist
npm run test
andnpm run benchmark