Skip to content

Commit 120661f

Browse files
authored
fix(types): missing supportedMethods (fastify#5970)
* fix(types): missing supportedMethods Signed-off-by: Johaven <[email protected]> * test(instance): supportedMethods --------- Signed-off-by: Johaven <[email protected]>
1 parent de610cc commit 120661f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

test/types/instance.test-d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ expectType<unknown>(server.getSchema('SchemaId'))
3636
expectType<string>(server.printRoutes())
3737
expectType<string>(server.printPlugins())
3838
expectType<string>(server.listeningOrigin)
39+
expectType<string[]>(server.supportedMethods)
3940

4041
expectAssignable<FastifyInstance>(
4142
server.setErrorHandler(function (error, request, reply) {

types/instance.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,10 @@ export interface FastifyInstance<
548548
* Remove all content type parsers, including the default ones
549549
*/
550550
removeAllContentTypeParsers: removeAllContentTypeParsers
551+
/**
552+
* Returns an array of strings containing the list of supported HTTP methods
553+
*/
554+
supportedMethods: string[]
551555
/**
552556
* Add a non-standard HTTP method
553557
*

0 commit comments

Comments
 (0)