mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
Feat: support wildcard from adguard filter
This commit is contained in:
@@ -52,14 +52,12 @@ export class AdGuardHome extends BaseWriteStrategy {
|
||||
}
|
||||
}
|
||||
|
||||
writeDomainWildcards(wildcards: Set<string>): void {
|
||||
for (const wildcard of wildcards) {
|
||||
const processed = wildcard.replaceAll('?', '*');
|
||||
if (processed.startsWith('*.')) {
|
||||
this.result.push(`||${processed.slice(2)}^`);
|
||||
} else {
|
||||
this.result.push(`|${processed}^`);
|
||||
}
|
||||
writeDomainWildcard(wildcard: string): void {
|
||||
const processed = wildcard.replaceAll('?', '*');
|
||||
if (processed.startsWith('*.')) {
|
||||
this.result.push(`||${processed.slice(2)}^`);
|
||||
} else {
|
||||
this.result.push(`|${processed}^`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user