Browse Source

Fix: parse filter

SukkaW 2 years ago
parent
commit
42fdf6c903
1 changed files with 5 additions and 5 deletions
  1. 5 5
      Build/lib/parse-filter.js

+ 5 - 5
Build/lib/parse-filter.js

@@ -39,7 +39,7 @@ async function processDomainLists(domainListsUrl) {
       || line.startsWith('\r')
       || line.startsWith('\r')
       || line.startsWith('\n')
       || line.startsWith('\n')
     ) {
     ) {
-      return;
+      continue;
     }
     }
 
 
     const domainToAdd = line.trim();
     const domainToAdd = line.trim();
@@ -52,7 +52,7 @@ async function processDomainLists(domainListsUrl) {
     domainSets.add(domainToAdd);
     domainSets.add(domainToAdd);
   }
   }
 
 
-  return [...domainSets];
+  return domainSets;
 }
 }
 
 
 /**
 /**
@@ -71,10 +71,10 @@ async function processHosts(hostsUrl, includeAllSubDomain = false) {
   const rl = await fetchRemoteTextAndCreateReadlineInterface(hostsUrl);
   const rl = await fetchRemoteTextAndCreateReadlineInterface(hostsUrl);
   for await (const line of rl) {
   for await (const line of rl) {
     if (line.includes('#')) {
     if (line.includes('#')) {
-      return;
+      continue;
     }
     }
     if (line.startsWith(' ') || line.startsWith('\r') || line.startsWith('\n') || line.trim() === '') {
     if (line.startsWith(' ') || line.startsWith('\r') || line.startsWith('\n') || line.trim() === '') {
-      return;
+      continue;
     }
     }
     const [, ...domains] = line.split(' ');
     const [, ...domains] = line.split(' ');
     const _domain = domains.join(' ').trim();
     const _domain = domains.join(' ').trim();
@@ -96,7 +96,7 @@ async function processHosts(hostsUrl, includeAllSubDomain = false) {
 
 
   console.timeEnd(`   - processHosts: ${hostsUrl}`);
   console.timeEnd(`   - processHosts: ${hostsUrl}`);
 
 
-  return [...domainSets];
+  return domainSets;
 }
 }
 
 
 /**
 /**