From eeb84c5f110d6d9c71c46c30b7bbaed1a213e997 Mon Sep 17 00:00:00 2001 From: Keita Kobayashi Date: Fri, 27 Dec 2024 11:45:11 +0900 Subject: [PATCH] =?UTF-8?q?=E7=94=BA=E5=AD=97=E3=81=AE=E3=83=9E=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=91=E3=82=BF=E3=83=BC=E3=83=B3=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #6 --- src/lib/abr_mlit_merge_tools.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/abr_mlit_merge_tools.ts b/src/lib/abr_mlit_merge_tools.ts index 56f339c..c234aa3 100644 --- a/src/lib/abr_mlit_merge_tools.ts +++ b/src/lib/abr_mlit_merge_tools.ts @@ -9,9 +9,11 @@ export function createMergedApiData(abrData: SingleMachiAza[], mlitData: NlftpMl const out = abrData; for (const row of mlitData) { + // ABRデータに重複があるかのチェック if (abrData.find(a => ( - (a.oaza_cho === row.oaza_cho && a.chome === row.chome) || - a.koaza === row.oaza_cho + (a.oaza_cho === row.oaza_cho && a.chome === row.chome) || // 大字と丁目が一致する場合 + (a.koaza === row.oaza_cho) || // 小字が一致する場合 + ((a.oaza_cho || '') + (a.koaza || '') === row.oaza_cho) // 大字と小字を結合したものが一致する場合 ))) { continue; }