lint code

This commit is contained in:
2025-04-14 12:36:04 +02:00
parent 2298c1c115
commit 0db5831116
20 changed files with 1128 additions and 548 deletions

View File

@@ -10,7 +10,8 @@ export async function loadChat(slug: string): Promise<Message[]> {
const data = await $fetch<string>(`/api/chats/${slug}`)
const dataString = JSON.stringify(data)
if (dataString === '[]') return []
if (dataString === '[]')
return []
return JSON.parse(dataString)
}
@@ -20,14 +21,14 @@ async function createChat(slug: string) {
body: {
file: {
name: `${slug}.json`,
content: '[]'
}
}
content: '[]',
},
},
})
}
export async function deleteChat(slug: string) {
await $fetch(`/api/chats/${slug}.json`, {
method: 'DELETE'
method: 'DELETE',
})
}

View File

@@ -5,7 +5,8 @@ export async function streamToText(stream: ReadableStream<Uint8Array>) {
while (true) {
const { done, value } = await reader.read()
if (done) break
if (done)
break
result += decoder.decode(value, { stream: true })
}