chatMessagePartTSName derives a TypeScript interface name from a ChatMessagePartType literal. "tool-call" → "ChatToolCallPart".
(t codersdk.ChatMessagePartType)
| 300 | // chatMessagePartTSName derives a TypeScript interface name from |
| 301 | // a ChatMessagePartType literal. "tool-call" → "ChatToolCallPart". |
| 302 | func chatMessagePartTSName(t codersdk.ChatMessagePartType) string { |
| 303 | words := strings.Split(string(t), "-") |
| 304 | for i, w := range words { |
| 305 | if len(w) > 0 { |
| 306 | words[i] = strings.ToUpper(w[:1]) + w[1:] |
| 307 | } |
| 308 | } |
| 309 | return "Chat" + strings.Join(words, "") + "Part" |
| 310 | } |
| 311 | |
| 312 | // FixSerpentStruct fixes 'serpent.Struct'. |
| 313 | // 'serpent.Struct' overrides the json.Marshal to use the underlying type, |
no outgoing calls
no test coverage detected