Refactor: refine writing strategy
Some checks are pending
Build / Build (push) Waiting to run
Build / Diff output (push) Blocked by required conditions
Build / Deploy to Cloudflare Pages (push) Blocked by required conditions
Build / Deploy to GitHub and GitLab (push) Blocked by required conditions

This commit is contained in:
SukkaW
2025-02-01 00:04:09 +08:00
parent 3926fb3484
commit 2035f5ea96
8 changed files with 41 additions and 35 deletions

View File

@@ -6,16 +6,15 @@ import { SurgeRuleSet } from '../writing-strategy/surge';
import { FileOutput } from './base';
export class IPListOutput extends FileOutput {
protected type = 'ip' as const;
strategies: Array<false | BaseWriteStrategy>;
constructor(span: Span, id: string, private readonly clashUseRule = true) {
super(span, id);
this.strategies = [
new SurgeRuleSet(this.type),
this.clashUseRule ? new ClashClassicRuleSet(this.type) : new ClashIPSet(),
new SingboxSource(this.type)
new SurgeRuleSet('ip'),
this.clashUseRule ? new ClashClassicRuleSet('ip') : new ClashIPSet(),
new SingboxSource('ip')
];
}
}