MCPcopy Create free account
hub / github.com/VPSDance/ai-proxy-rules / normalizeRuleSet

Function normalizeRuleSet

scripts/rules.ts:39–49  ·  view source on GitHub ↗
(rules: RuleSet)

Source from the content-addressed store, hash-verified

37}
38
39export function normalizeRuleSet(rules: RuleSet): RuleSet {
40 return {
41 domain: normalizeDnsRules(rules.domain),
42 domainSuffix: normalizeDnsRules(rules.domainSuffix),
43 domainKeyword: normalizeTextRules(rules.domainKeyword),
44 domainRegex: normalizeTextRules(rules.domainRegex),
45 ipCidr: normalizeTextRules(rules.ipCidr),
46 ipCidr6: normalizeTextRules(rules.ipCidr6),
47 asn: normalizeAsnRules(rules.asn)
48 };
49}
50
51export function subtractRuleSet(source: RuleSet, remove: RuleSet): RuleSet {
52 const normalizedSource = normalizeRuleSet(source);

Callers 9

normalizeRuleGroupsFunction · 0.85
mergeRuleSetsFunction · 0.85
subtractRuleSetFunction · 0.85
pickRuleKeysFunction · 0.85
removeCoveredDomainsFunction · 0.85
compactRuleSetFunction · 0.85
parseClassicalRulesFunction · 0.85
normalizePartialRuleSetFunction · 0.85

Calls 3

normalizeDnsRulesFunction · 0.85
normalizeTextRulesFunction · 0.85
normalizeAsnRulesFunction · 0.85

Tested by

no test coverage detected