MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveOutputFormat

Function resolveOutputFormat

apps/sim/lib/copilot/request/tools/files.ts:124–128  ·  view source on GitHub ↗
(fileName: string, explicit?: string)

Source from the content-addressed store, hash-verified

122}
123
124export function resolveOutputFormat(fileName: string, explicit?: string): OutputFormat {
125 if (explicit && explicit in FORMAT_TO_CONTENT_TYPE) return explicit as OutputFormat
126 const ext = fileName.slice(fileName.lastIndexOf('.')).toLowerCase()
127 return EXT_TO_FORMAT[ext] ?? 'json'
128}
129
130export function serializeOutputForFile(output: unknown, format: OutputFormat): string {
131 const unwrapped = unwrapFunctionExecuteOutput(output)

Calls

no outgoing calls

Tested by

no test coverage detected