MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / quoteSegmentIfNeeded

Function quoteSegmentIfNeeded

internal/tools/codex_postwrite.go:50–58  ·  view source on GitHub ↗

quoteSegmentIfNeeded wraps name in TOML quotes when it would not be a bare key (e.g. contains a hyphen or slash).

(name string)

Source from the content-addressed store, hash-verified

48// quoteSegmentIfNeeded wraps name in TOML quotes when it would not be a
49// bare key (e.g. contains a hyphen or slash).
50func quoteSegmentIfNeeded(name string) string {
51 for _, ch := range name {
52 isAlnum := (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || ch == '_'
53 if !isAlnum {
54 return `"` + name + `"`
55 }
56 }
57 return name
58}

Callers 1

applyCodexWireAPIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected