mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-13 17:50:34 +08:00
Feat: enable merge for IP rules
This commit is contained in:
parent
907c19588f
commit
7acda2b5a4
@ -3,6 +3,8 @@ import { appendArrayFromSet } from '../misc';
|
||||
import type { SingboxSourceFormat } from '../singbox';
|
||||
import { RuleOutput } from './base';
|
||||
|
||||
import { merge } from 'fast-cidr-tools';
|
||||
|
||||
export class IPListOutput extends RuleOutput {
|
||||
protected type = 'ip' as const;
|
||||
|
||||
@ -13,7 +15,7 @@ export class IPListOutput extends RuleOutput {
|
||||
private $merged: string[] | null = null;
|
||||
get merged() {
|
||||
if (!this.$merged) {
|
||||
this.$merged = appendArrayFromSet(appendArrayFromSet([], this.ipcidr), this.ipcidr6);
|
||||
this.$merged = merge(appendArrayFromSet([], [this.ipcidr, this.ipcidr6]));
|
||||
}
|
||||
return this.$merged;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user