From a503f4e24e70c716c76c177280718cc135bac9e6 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Thu, 17 Nov 2022 02:30:42 -0500 Subject: [PATCH] [F] Avoid duplicates --- scripts/build.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build.ts b/scripts/build.ts index c34d82d9..5a2c0b17 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -41,7 +41,9 @@ function buildPeopleInfoAndList() { ...Object.fromEntries(PEOPLE_LIST_KEYS.map(key => [key, info[key]])) } as PeopleMeta; - peopleList.push(peopleMeta); + // Avoid duplicates + if (peopleList.filter(it => it.id == peopleMeta.id).length == 0) + peopleList.push(peopleMeta); // Combine comments in people/${dirname}/comments/${cf}.json const commentPath = path.join(srcPath, COMMENTS_DIR)