MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / NormalizeExcludedModels

Function NormalizeExcludedModels

internal/config/config.go:1127–1148  ·  view source on GitHub ↗

NormalizeExcludedModels trims, lowercases, and deduplicates model exclusion patterns. It preserves the order of first occurrences and drops empty entries.

(models []string)

Source from the content-addressed store, hash-verified

1125// NormalizeExcludedModels trims, lowercases, and deduplicates model exclusion patterns.
1126// It preserves the order of first occurrences and drops empty entries.
1127func NormalizeExcludedModels(models []string) []string {
1128 if len(models) == 0 {
1129 return nil
1130 }
1131 seen := make(map[string]struct{}, len(models))
1132 out := make([]string, 0, len(models))
1133 for _, raw := range models {
1134 trimmed := strings.ToLower(strings.TrimSpace(raw))
1135 if trimmed == "" {
1136 continue
1137 }
1138 if _, exists := seen[trimmed]; exists {
1139 continue
1140 }
1141 seen[trimmed] = struct{}{}
1142 out = append(out, trimmed)
1143 }
1144 if len(out) == 0 {
1145 return nil
1146 }
1147 return out
1148}
1149
1150// NormalizeOAuthExcludedModels cleans provider -> excluded models mappings by normalizing provider keys
1151// and applying model exclusion normalization to each entry.

Callers 14

PatchGeminiKeyMethod · 0.92
PatchClaudeKeyMethod · 0.92
PatchVertexCompatKeyMethod · 0.92
PatchCodexKeyMethod · 0.92
normalizeClaudeKeyFunction · 0.92
normalizeCodexKeyFunction · 0.92
normalizeVertexCompatKeyFunction · 0.92
SanitizeCodexKeysMethod · 0.85
SanitizeClaudeKeysMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected