Function: methodMatcher()
Function: methodMatcher()
function methodMatcher<IncomingEventType, OutgoingResponseType>(options): boolean;
Matches the HTTP method of an incoming HTTP event against a route's method configuration.
Type Parameters
IncomingEventType
IncomingEventType
extends IIncomingEvent
= IIncomingEvent
The type representing the incoming HTTP event.
OutgoingResponseType
OutgoingResponseType
= unknown
The type representing the outgoing HTTP response.
Parameters
options
MatcherOptions
<IncomingEventType
, OutgoingResponseType
>
The matcher options containing the route and event.
Returns
boolean
true
if the method matches, otherwise false
.
Example
const match = methodMatcher({ route, event });
console.log(match); // true or false