MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / detectFormat

Method detectFormat

src/services/import/fetch.ts:82–90  ·  view source on GitHub ↗
(file: File | string)

Source from the content-addressed store, hash-verified

80 }
81
82 async detectFormat(file: File | string): Promise<FormatInfo | null> {
83 if (typeof file === 'string') return null
84 const form = new FormData()
85 form.append('file', file)
86 const res = await fetchWithAuth(`${getBaseUrl()}/detect-format`, { method: 'POST', body: form })
87 if (!res.ok) return null
88 const data = (await res.json()) as { format: FormatInfo | null }
89 return data.format
90 }
91
92 async scanMultiChatFile(file: File | string): Promise<MultiChatEntry[]> {
93 if (typeof file === 'string') return []

Callers

nothing calls this directly

Calls 2

fetchWithAuthFunction · 0.90
getBaseUrlFunction · 0.90

Tested by

no test coverage detected