mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-14 18:20:35 +08:00
Fix: parse filter
This commit is contained in:
parent
6aeb5def04
commit
42fdf6c903
@ -39,7 +39,7 @@ async function processDomainLists(domainListsUrl) {
|
||||
|| line.startsWith('\r')
|
||||
|| line.startsWith('\n')
|
||||
) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
const domainToAdd = line.trim();
|
||||
@ -52,7 +52,7 @@ async function processDomainLists(domainListsUrl) {
|
||||
domainSets.add(domainToAdd);
|
||||
}
|
||||
|
||||
return [...domainSets];
|
||||
return domainSets;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,10 +71,10 @@ async function processHosts(hostsUrl, includeAllSubDomain = false) {
|
||||
const rl = await fetchRemoteTextAndCreateReadlineInterface(hostsUrl);
|
||||
for await (const line of rl) {
|
||||
if (line.includes('#')) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
if (line.startsWith(' ') || line.startsWith('\r') || line.startsWith('\n') || line.trim() === '') {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
const [, ...domains] = line.split(' ');
|
||||
const _domain = domains.join(' ').trim();
|
||||
@ -96,7 +96,7 @@ async function processHosts(hostsUrl, includeAllSubDomain = false) {
|
||||
|
||||
console.timeEnd(` - processHosts: ${hostsUrl}`);
|
||||
|
||||
return [...domainSets];
|
||||
return domainSets;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user