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

Function compactRuleSet

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

Source from the content-addressed store, hash-verified

87}
88
89export function compactRuleSet(rules: RuleSet): Partial<RuleSet> {
90 const normalized = normalizeRuleSet(rules);
91 const compacted: Partial<RuleSet> = {};
92
93 for (const key of ruleKeys) {
94 if (normalized[key].length > 0) {
95 compacted[key] = normalized[key] as never;
96 }
97 }
98
99 return compacted;
100}
101
102function isDomainCoveredBySuffix(domain: string, suffix: string): boolean {
103 return domain === suffix || domain.endsWith(`.${suffix}`);

Callers 1

compactGroupsFunction · 0.85

Calls 1

normalizeRuleSetFunction · 0.85

Tested by

no test coverage detected