mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Update Reject & Domestic Rules
This commit is contained in:
@@ -128,6 +128,27 @@ export class DomainsetOutput extends RuleOutput<Preprocessed> {
|
||||
results.push(`/${keyword}/`);
|
||||
}
|
||||
|
||||
for (const ipGroup of [this.ipcidr, this.ipcidrNoResolve]) {
|
||||
for (const ipcidr of ipGroup) {
|
||||
if (ipcidr.endsWith('/32')) {
|
||||
results.push(`||${ipcidr.slice(0, -3)}`);
|
||||
} else if (ipcidr.endsWith('.0/24')) {
|
||||
results.push(`||${ipcidr.slice(0, -6)}.*`);
|
||||
} else {
|
||||
results.push(`||${ipcidr}^`);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const ipGroup of [this.ipcidr6, this.ipcidr6NoResolve]) {
|
||||
for (const ipcidr of ipGroup) {
|
||||
if (ipcidr.endsWith('/128')) {
|
||||
results.push(`||${ipcidr.slice(0, -4)}`);
|
||||
} else {
|
||||
results.push(`||${ipcidr}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user