MCPcopy Create free account
hub / github.com/Nutlope/llamacoder / parseFileName

Function parseFileName

lib/utils.ts:86–97  ·  view source on GitHub ↗
(fileName: string)

Source from the content-addressed store, hash-verified

84}
85
86function parseFileName(fileName: string): { name: string; extension: string } {
87 // Split the string at the last dot
88 const lastDotIndex = fileName.lastIndexOf(".");
89 if (lastDotIndex === -1) {
90 // No dot found
91 return { name: fileName, extension: "" };
92 }
93 return {
94 name: fileName.slice(0, lastDotIndex),
95 extension: fileName.slice(lastDotIndex + 1),
96 };
97}
98
99// New: Parse an assistant reply into ordered text and file segments.
100// Supports multiple files per reply and interleaved text. Streaming-safe: returns

Callers 1

extractFirstCodeBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected