MCPcopy Create free account
hub / github.com/denoland/std / methodMatches

Function methodMatches

http/unstable_route.ts:53–62  ·  view source on GitHub ↗
(
  routeMethod: string | string[] | undefined,
  requestMethod: string,
)

Source from the content-addressed store, hash-verified

51}
52
53function methodMatches(
54 routeMethod: string | string[] | undefined,
55 requestMethod: string,
56): boolean {
57 if (!routeMethod) return true;
58 if (Array.isArray(routeMethod)) {
59 return routeMethod.some((m) => m.toUpperCase() === requestMethod);
60 }
61 return routeMethod.toUpperCase() === requestMethod;
62}
63
64/**
65 * Routes requests to handlers using a linear scan over all routes.

Callers 2

routeLinearFunction · 0.85
tryRouteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected