mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 09:10:35 +08:00
Build stable reject domainsets
This commit is contained in:
parent
a63b9616e0
commit
1634408060
@ -208,6 +208,12 @@ const domainSuffixSet = new Set();
|
|||||||
if (a.domain < b.domain) {
|
if (a.domain < b.domain) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (a.v > b.v) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (a.v < b.v) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
const sortedDomainSets = dudupedDominArray
|
const sortedDomainSets = dudupedDominArray
|
||||||
@ -242,7 +248,13 @@ const domainSuffixSet = new Set();
|
|||||||
await fs.promises.writeFile(
|
await fs.promises.writeFile(
|
||||||
pathResolve(__dirname, '../List/internal/reject-stats.txt'),
|
pathResolve(__dirname, '../List/internal/reject-stats.txt'),
|
||||||
Object.entries(rejectDomainsStats)
|
Object.entries(rejectDomainsStats)
|
||||||
.sort((a, b) => b[1] - a[1])
|
.sort((a, b) => {
|
||||||
|
const t = b[1] - a[1];
|
||||||
|
if (t === 0) {
|
||||||
|
return a[0].localeCompare(b[0]);
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
})
|
||||||
.map(([domain, count]) => `${domain}${' '.repeat(100 - domain.length)}${count}`)
|
.map(([domain, count]) => `${domain}${' '.repeat(100 - domain.length)}${count}`)
|
||||||
.join('\n')
|
.join('\n')
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user