Skip to content

Commit 6a6a755

Browse files
committed
chore: make request method not optional param
1 parent 8028c80 commit 6a6a755

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/middleware-allow-request-methods/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const { UserInputError } = require('@dotcom-reliability-kit/errors');
1111
/**
1212
* Create a middleware function to return 405 (rather than 404) for disallowed request methods.
1313
*
14-
* @param {RequestMethodOptions} [options]
14+
* @param {RequestMethodOptions} options
1515
* @returns {RequestHandler} - Returns an Express middleware function.
1616
*/
1717
function allowRequestMethods(options = { allowedMethods: [] }) {

packages/middleware-allow-request-methods/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { RequestHandler } from 'express';
22

33
declare module '@dotcom-reliability-kit/middleware-allow-request-methods' {
44
export type RequestMethodOptions = {
5-
allowedMethods?: string[];
5+
allowedMethods: string[];
66
};
77

88
declare function allowRequestMethods(
9-
options?: RequestMethodOptions
9+
options: RequestMethodOptions
1010
): RequestHandler;
1111
}

0 commit comments

Comments
 (0)