From bd9f4bd3f8098001b20bb890aed19c9053682b88 Mon Sep 17 00:00:00 2001 From: Semih Yesilyurt Date: Sun, 20 Sep 2026 09:32:24 +0300 Subject: [PATCH] =?UTF-8?q?style(pl24):=20normalizeLabel'daki=20yan=C4=B1l?= =?UTF-8?q?t=C4=B1c=C4=B1=20karakter=20s=C4=B1n=C4=B1f=C4=B1n=C4=B1=20d?= =?UTF-8?q?=C3=BCzelt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `[̀-ͯ]` bir aralık sınıfı; biome bunu "bir taban karakter + birleştirici karakter çiftini de eşleyebilir" diye işaretliyordu. NFD zaten her aksanı kendi işaretine ayırdığı için doğrudan `\p{M}` (tüm birleştirici işaretler) hem doğru hem daha geniş. Gerçek Volvo/PSA/Subaru yakalamalarıyla çıktı birebir aynı kaldı. Co-Authored-By: Claude Opus 5 (1M context) --- .../api/src/integrations/pl24/pl24.service.ts | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/api/src/integrations/pl24/pl24.service.ts b/apps/api/src/integrations/pl24/pl24.service.ts index ca1f545..bb97b93 100644 --- a/apps/api/src/integrations/pl24/pl24.service.ts +++ b/apps/api/src/integrations/pl24/pl24.service.ts @@ -66,13 +66,20 @@ const LEGACY_ARCH_SOURCE_TAG: Record = { * single spelling matches both "Model yılı" and "MODEL YILI". */ export function normalizeLabel(label: string): string { - return label - .toLocaleLowerCase("tr") - .normalize("NFD") - .replace(/[\u0300-\u036f]/g, "") - .replace(/ı/g, "i") - .replace(/[\s/]+/g, "_") - .trim(); + return ( + label + .toLocaleLowerCase("tr") + .normalize("NFD") + // \p{M} (all combining marks) rather than the U+0300–U+036F range: the range + // is a character class that can also match a base character followed by a + // combining one, which biome flags as misleading. NFD has already split every + // accent into its own mark, so matching marks directly is both correct and + // broader (Turkish, Latin-Extended, anything PL24 sends). + .replace(/\p{M}/gu, "") + .replace(/ı/g, "i") + .replace(/[\s/]+/g, "_") + .trim() + ); } /**