Feat: support wildcard from adguard filter

This commit is contained in:
SukkaW
2025-06-20 17:28:09 +08:00
parent 515f262042
commit 6da1069147
11 changed files with 230 additions and 77 deletions

View File

@@ -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}^`);
}
}