From dc4e1b1155541a772d3dc12b201351b84fc08938 Mon Sep 17 00:00:00 2001 From: mrrfv Date: Fri, 8 Sep 2023 19:58:31 +0200 Subject: [PATCH] Only show the count of whitelisted domains --- cf_list_create.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cf_list_create.js b/cf_list_create.js index 5b247fa..2464663 100644 --- a/cf_list_create.js +++ b/cf_list_create.js @@ -91,13 +91,15 @@ fs.readFile('input.csv', 'utf8', async (err, data) => { domains = uniqueDomains; // Remove domains from the domains array that are present in the whitelist array + let whitelistedDomainCount = 0; domains = domains.filter(domain => { if (whitelist.includes(domain)) { - console.warn(`Domain found in the whitelist: ${domain} - removing`); + whitelistedDomainCount++; return false; } return true; }); + if (whitelistedDomainCount > 0) console.warn(`Found ${whitelistedDomainCount} domains in input.csv that are present in the whitelist - removing them`); // Trim array to 300,000 domains if it's longer than that if (domains.length > LIST_ITEM_LIMIT) {