Refactor: remove domain wildcard to regex fallback

This change will not affect widely used app like
Surge/Mihomo/QuanX/Shadowrocket, as they most likely already support
native `DOMAIN-WILDCARD`.
This commit is contained in:
SukkaW
2026-03-09 23:15:15 +08:00
parent 0c02e84a68
commit 5e9a2cc605
2 changed files with 1 additions and 96 deletions

View File

@@ -46,27 +46,6 @@ export abstract class BaseWriteStrategy {
protected abstract withPadding(title: string, description: string[] | readonly string[], date: Date, content: string[]): string[];
static readonly domainWildCardToRegex = (domain: string) => {
let result = '^';
for (let i = 0, len = domain.length; i < len; i++) {
switch (domain[i]) {
case '.':
result += String.raw`\.`;
break;
case '*':
result += String.raw`[\w.-]*?`;
break;
case '?':
result += String.raw`[\w.-]`;
break;
default:
result += domain[i];
}
}
result += '$';
return result;
};
public output(
span: Span,
title: string,