MCPcopy Create free account
hub / github.com/coder/coder / NormalizedEnumValue

Function NormalizedEnumValue

coderd/x/chatd/chatutil/chatutil.go:20–28  ·  view source on GitHub ↗

NormalizedEnumValue returns the canonical allowed value matching value after case normalization, or nil when no value matches.

(value string, allowed ...string)

Source from the content-addressed store, hash-verified

18// NormalizedEnumValue returns the canonical allowed value matching value after
19// case normalization, or nil when no value matches.
20func NormalizedEnumValue(value string, allowed ...string) *string {
21 for _, candidate := range allowed {
22 if value == strings.ToLower(candidate) {
23 match := candidate
24 return &match
25 }
26 }
27 return nil
28}

Callers 4

TestNormalizedEnumValueFunction · 0.92
TextVerbosityFromChatFunction · 0.92
ReasoningEffortFromChatFunction · 0.92
ReasoningEffortFromChatFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestNormalizedEnumValueFunction · 0.74