( routeMethod: string | string[] | undefined, requestMethod: string, )
| 51 | } |
| 52 | |
| 53 | function 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. |
no outgoing calls
no test coverage detected