From fae89677e1db3457db68c58728cd3ba2eda04c2c Mon Sep 17 00:00:00 2001 From: Mike Wu Date: Wed, 11 Sep 2024 22:07:39 +0900 Subject: [PATCH] replace regex with endswith --- src/lib/blueprint.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/blueprint.ts b/src/lib/blueprint.ts index dc31d59..2c47275 100644 --- a/src/lib/blueprint.ts +++ b/src/lib/blueprint.ts @@ -318,9 +318,7 @@ const getNamespace = (path: string, paths: OpenapiPaths): string | null => { // An endpoint is a route that ends without further paths. i.e., ends in // a letter (not slash). - const endpoints = pathKeys.filter((key) => - new RegExp(`^/${[...namespace, part].join('/')}/\\w+$`).test(key), - ) + const endpoints = pathKeys.filter((key) => !key.endsWith('/')) if (endpoints.length === 0) { namespace.push(part)