From 6c6c8448fad705e654a3b4bc63e28fe67334a32d Mon Sep 17 00:00:00 2001 From: Jakob Guddas Date: Sun, 22 Oct 2023 13:06:07 +0200 Subject: [PATCH] fix: duplicate Next.js aliases (#1631) --- scripts/generateNextJSAliases.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/generateNextJSAliases.mjs b/scripts/generateNextJSAliases.mjs index 332ae7fe21c..f4f241a2892 100644 --- a/scripts/generateNextJSAliases.mjs +++ b/scripts/generateNextJSAliases.mjs @@ -37,7 +37,9 @@ Promise.all( const iconMetaData = JSON.parse(metaJson); const aliases = iconMetaData.aliases ?? []; - aliases.push(iconNameKebabCaseNextjsFlavour); + if (!aliases.includes(iconNameKebabCaseNextjsFlavour)) { + aliases.push(iconNameKebabCaseNextjsFlavour); + } const output = JSON.stringify({ ...iconMetaData, aliases }, null, 2); fs.writeFile(path.resolve(ICONS_DIR, `${iconName}.json`), output, 'utf-8');