mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Chore: minor changes
This commit is contained in:
@@ -97,7 +97,7 @@ export class RulesetOutput extends RuleOutput {
|
||||
const singbox: SingboxSourceFormat = {
|
||||
version: 2,
|
||||
rules: [{
|
||||
domain: ['this_ruleset_is_made_by_sukkaw.ruleset.skk.moe'].concat(this.computed()[0]),
|
||||
domain: appendArrayInPlace(['this_ruleset_is_made_by_sukkaw.ruleset.skk.moe'], this.computed()[0]),
|
||||
domain_suffix: this.computed()[1],
|
||||
domain_keyword: Array.from(this.domainKeywords),
|
||||
domain_regex: Array.from(this.domainWildcard).map(RuleOutput.domainWildCardToRegex),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { domainWildCardToRegex } from './misc';
|
||||
import { isProbablyIpv4, isProbablyIpv6 } from './is-fast-ip';
|
||||
|
||||
const unsupported = Symbol('unsupported');
|
||||
@@ -10,13 +9,6 @@ const toNumberTuple = <T extends string>(key: T, value: string): [T, number] | n
|
||||
|
||||
// https://sing-box.sagernet.org/configuration/rule-set/source-format/
|
||||
export const PROCESSOR: Record<string, ((raw: string, type: string, value: string) => [key: keyof SingboxHeadlessRule, value: Required<SingboxHeadlessRule>[keyof SingboxHeadlessRule][number]] | null) | typeof unsupported> = {
|
||||
DOMAIN: (_1, _2, value) => ['domain', value],
|
||||
'DOMAIN-SUFFIX': (_1, _2, value) => ['domain_suffix', value],
|
||||
'DOMAIN-KEYWORD': (_1, _2, value) => ['domain_keyword', value],
|
||||
'DOMAIN-WILDCARD': (_1, _2, value) => ['domain_regex', domainWildCardToRegex(value)],
|
||||
GEOIP: unsupported,
|
||||
'IP-CIDR': (_1, _2, value) => ['ip_cidr', value.endsWith(',no-resolve') ? value.slice(0, -11) : value],
|
||||
'IP-CIDR6': (_1, _2, value) => ['ip_cidr', value.endsWith(',no-resolve') ? value.slice(0, -11) : value],
|
||||
'IP-ASN': unsupported,
|
||||
'SRC-IP': (_1, _2, value) => {
|
||||
if (value.includes('/')) {
|
||||
|
||||
Reference in New Issue
Block a user