From 70ada3873de91823f0671cedbe348fa2bddface7 Mon Sep 17 00:00:00 2001 From: sebo <sebastian.bergandy@external.mgm-cp.com> Date: Sun, 23 Mar 2025 19:40:06 +0100 Subject: [PATCH] OZG-7473 extract regex to const Based on CR comment. --- .../tech-shared/src/lib/validation/tech.validation.util.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/alfa-client/libs/tech-shared/src/lib/validation/tech.validation.util.ts b/alfa-client/libs/tech-shared/src/lib/validation/tech.validation.util.ts index 8ea81cca8d..638689f2ba 100644 --- a/alfa-client/libs/tech-shared/src/lib/validation/tech.validation.util.ts +++ b/alfa-client/libs/tech-shared/src/lib/validation/tech.validation.util.ts @@ -111,5 +111,6 @@ export function getFieldPath(name: string, pathPrefix: string): string { } export function _mapFormArrayElementNameToPath(name: string): string { - return name.replace(/\[(\d+?)]\./g, '.$1.'); + const formArrayControlIndexCaptureGroup: RegExp = /\[(\d+?)]\./g; + return name.replace(formArrayControlIndexCaptureGroup, '.$1.'); } -- GitLab