@@ -307,8 +307,9 @@ export class ApiRegistry {
307307 *
308308 * NOTE: This implementation uses exact string matching for route conflict detection.
309309 * It works well for static paths but has limitations with parameterized routes.
310- * For example, `/api/users/:id` and `/api/users/detail` will NOT be detected as conflicts
311- * even though they may overlap at runtime depending on the routing library.
310+ * For example, `/api/users/:id` and `/api/users/:userId` will NOT be detected as conflicts
311+ * even though they are semantically identical parameterized patterns. Similarly,
312+ * `/api/:resource/list` and `/api/:entity/list` would also not be detected as conflicting.
312313 *
313314 * For more advanced conflict detection (e.g., path-to-regexp pattern matching),
314315 * consider integrating with your routing library's conflict detection mechanism.
@@ -580,7 +581,7 @@ export class ApiRegistry {
580581 * ```
581582 */
582583 clear ( options : { force ?: boolean } = { } ) : void {
583- const isProduction = process . env . NODE_ENV === 'production' ;
584+ const isProduction = this . isProductionEnvironment ( ) ;
584585
585586 if ( isProduction && ! options . force ) {
586587 throw new Error (
@@ -719,4 +720,15 @@ export class ApiRegistry {
719720 }
720721 }
721722 }
723+
724+ /**
725+ * Check if running in production environment
726+ *
727+ * @returns true if NODE_ENV is 'production'
728+ * @private
729+ * @internal
730+ */
731+ private isProductionEnvironment ( ) : boolean {
732+ return process . env . NODE_ENV === 'production' ;
733+ }
722734}
0 commit comments