We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fed4192 commit ddf1d2fCopy full SHA for ddf1d2f
packages/event-handler/src/rest/RouteHandlerRegistry.ts
@@ -1,4 +1,5 @@
1
import type { GenericLogger } from '@aws-lambda-powertools/commons/types';
2
+import { isRegExp } from '@aws-lambda-powertools/commons/typeutils';
3
import type {
4
DynamicRoute,
5
HttpMethod,
@@ -105,7 +106,7 @@ class RouteHandlerRegistry {
105
106
107
const compiled = compilePath(route.path);
108
- if (route.path instanceof RegExp) {
109
+ if (isRegExp(route.path)) {
110
if (this.#regexRoutes.has(route.id)) {
111
this.#logger.warn(
112
`Handler for method: ${route.method} and path: ${route.path} already exists. The previous handler will be replaced.`
0 commit comments