From aec80a68c87dda435715ca7e86acd001b398946e Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Mon, 9 Dec 2024 12:22:55 +0100 Subject: [PATCH] chore(scripts/reorder-search-index): refine comments --- scripts/reorder-search-index.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/reorder-search-index.mjs b/scripts/reorder-search-index.mjs index 4bfffb4811e5..593ab7a83c72 100644 --- a/scripts/reorder-search-index.mjs +++ b/scripts/reorder-search-index.mjs @@ -16,15 +16,15 @@ async function main() { const result = []; - // Add all reference items that are in the reference. + // Add entry for each reference item. for (const [refIndex, slug] of refSlugs.entries()) { const inputIndex = inputSlugs.indexOf(slug); - // Use reference item where index does not have this item. + // Use reference item if it's currently missing in index. const item = inputIndex !== -1 ? input[inputIndex] : ref[refIndex]; result.push(item); } - // Add items that are NOT in the reference (e.g. moved/removed). + // Add entry for any item that is NOT in the reference (e.g. moved/removed). for (const [inputIndex, slug] of inputSlugs.entries()) { if (!refSlugs.includes(slug)) { const item = input[inputIndex];