mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-03 04:21:53 +08:00
Refactor: improve stable sort domains
This commit is contained in:
@@ -39,8 +39,7 @@ export const buildInternalCDNDomains = task(import.meta.path, async (span) => {
|
||||
const proxySet = new Set<string>();
|
||||
const proxyKeywords = new Set<string>();
|
||||
|
||||
const gorhill = (await Promise.all([
|
||||
getGorhillPublicSuffixPromise(),
|
||||
await Promise.all([
|
||||
processLocalRuleSet(path.resolve(import.meta.dir, '../List/non_ip/cdn.conf'), proxySet, proxyKeywords),
|
||||
processLocalRuleSet(path.resolve(import.meta.dir, '../List/non_ip/global.conf'), proxySet, proxyKeywords),
|
||||
processLocalRuleSet(path.resolve(import.meta.dir, '../List/non_ip/my_proxy.conf'), proxySet, proxyKeywords),
|
||||
@@ -49,12 +48,12 @@ export const buildInternalCDNDomains = task(import.meta.path, async (span) => {
|
||||
processLocalRuleSet(path.resolve(import.meta.dir, '../List/non_ip/telegram.conf'), proxySet, proxyKeywords),
|
||||
processLocalDomainSet(path.resolve(import.meta.dir, '../List/domainset/cdn.conf'), proxySet),
|
||||
processLocalDomainSet(path.resolve(import.meta.dir, '../List/domainset/download.conf'), proxySet)
|
||||
]))[0];
|
||||
]);
|
||||
|
||||
return compareAndWriteFile(
|
||||
span,
|
||||
[
|
||||
...sortDomains(domainDeduper(Array.from(proxySet)), gorhill).map(i => `SUFFIX,${i}`),
|
||||
...sortDomains(domainDeduper(Array.from(proxySet))).map(i => `SUFFIX,${i}`),
|
||||
...sort(Array.from(proxyKeywords)).map(i => `REGEX,${i}`)
|
||||
],
|
||||
path.resolve(import.meta.dir, '../Internal/cdn.txt')
|
||||
|
||||
Reference in New Issue
Block a user