Skip to content

Commit

Permalink
Add statusCode to errorResponseBuilderContext type (#366)
Browse files Browse the repository at this point in the history
Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com>
  • Loading branch information
flakey5 authored Mar 16, 2024
1 parent 89a618f commit ec54839
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ declare namespace fastifyRateLimit {
export interface FastifyRateLimitOptions { }

export interface errorResponseBuilderContext {
statusCode: number;
ban: boolean;
after: string;
max: number;
Expand Down
8 changes: 8 additions & 0 deletions types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,11 @@ appWithHttp2.get('/public', {
}, (request, reply) => {
reply.send({ hello: 'from ... public' })
})

const errorResponseContext: errorResponseBuilderContext = {
statusCode: 429,
ban: true,
after: '123',
max: 1000,
ttl: 123
}

0 comments on commit ec54839

Please sign in to comment.