From 695d7c7f5a465ae1b20110935f1d3fa0f17f3061 Mon Sep 17 00:00:00 2001 From: Viet Huynh Date: Tue, 12 Sep 2023 20:19:09 +0700 Subject: [PATCH] fixed to count allowed domains correctly --- 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 ac9d951..76b1485 100644 --- a/cf_list_create.js +++ b/cf_list_create.js @@ -20,6 +20,7 @@ const blocklist = new Map(); const domains = []; let processedDomainCount = 0; let duplicateDomainCount = 0; +let allowedDomainCount = 0; // Read allowlist console.log(`Processing ${allowlistFilename}`); @@ -64,6 +65,7 @@ await readFile(resolve(blocklistFilename), (line, rl) => { if (allowlist.has(domain)) { console.log(`Found ${domain} in allowlist - Skipping...`); + allowedDomainCount++; return; } @@ -81,7 +83,7 @@ await readFile(resolve(blocklistFilename), (line, rl) => { console.log("\n\n"); console.log(`Number of processed domains: ${processedDomainCount}`); console.log(`Number of blocked domains: ${domains.length}`); -console.log(`Number of allowed domains: ${allowlist.size}`); +console.log(`Number of allowed domains: ${allowedDomainCount}`); console.log(`Number of duplicate domains: ${duplicateDomainCount}`); console.log( `Number of lists which will be created: ${Math.ceil(