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

Function normalizeExecutorFormats

internal/pluginhost/adapters.go:76–95  ·  view source on GitHub ↗
(raw []string)

Source from the content-addressed store, hash-verified

74}
75
76func normalizeExecutorFormats(raw []string) []sdktranslator.Format {
77 if len(raw) == 0 {
78 return nil
79 }
80 out := make([]sdktranslator.Format, 0, len(raw))
81 seen := make(map[string]struct{}, len(raw))
82 for _, item := range raw {
83 format := normalizeExecutorFormatName(item)
84 if format == "" {
85 continue
86 }
87 key := format.String()
88 if _, exists := seen[key]; exists {
89 continue
90 }
91 seen[key] = struct{}{}
92 out = append(out, format)
93 }
94 return out
95}
96
97func normalizeExecutorFormatName(raw string) sdktranslator.Format {
98 switch strings.ToLower(strings.TrimSpace(raw)) {

Callers 1

Calls 2

StringMethod · 0.45

Tested by

no test coverage detected