From 36f5624d89ee8388f572b655f5d2579a829bef0d Mon Sep 17 00:00:00 2001 From: Marco Carvalho Date: Mon, 16 Sep 2024 17:21:31 -0300 Subject: [PATCH] perf: "RegExp.exec" instead of "String.match" --- apps/web/src/hooks/useQueryArgs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/hooks/useQueryArgs.ts b/apps/web/src/hooks/useQueryArgs.ts index 4a01c75d..f50d1674 100644 --- a/apps/web/src/hooks/useQueryArgs.ts +++ b/apps/web/src/hooks/useQueryArgs.ts @@ -12,7 +12,7 @@ function extractParamValue( const regex = new RegExp(regexPattern) - const match = path.match(regex) + const match = regex.exec(path) return match?.[1] ?? '' }