From 80b37ebf43a75add3d4d9d65dc9911d04210a17d Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Sun, 19 Nov 2023 19:22:38 +0530 Subject: [PATCH] most-imported: don't process a script twice --- reports/most-imported-scripts/most-imported-scripts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reports/most-imported-scripts/most-imported-scripts.js b/reports/most-imported-scripts/most-imported-scripts.js index 3823e96..feb047c 100644 --- a/reports/most-imported-scripts/most-imported-scripts.js +++ b/reports/most-imported-scripts/most-imported-scripts.js @@ -50,9 +50,9 @@ process.chdir(__dirname); "pllimit": "max" }).then(json => { log('[S] Got basic script list'); - scriptList = json.query.search.map(e => e.title).concat( + scriptList = [...new Set(json.query.search.map(e => e.title).concat( json.query.pages[0].links.map(e => e.title).filter(e => e.endsWith('.js')) - ); + ))]; utils.saveObject('scriptList', scriptList); return scriptList; });