MCPcopy Create free account
hub / github.com/TurtleTrace2026/TurtleTrace / downloadFile

Function downloadFile

src/services/exportService.ts:280–290  ·  view source on GitHub ↗
(content: string, filename: string, mimeType: string)

Source from the content-addressed store, hash-verified

278
279// 下载文件到本地
280function downloadFile(content: string, filename: string, mimeType: string): void {
281 const blob = new Blob([content], { type: mimeType })
282 const url = URL.createObjectURL(blob)
283 const link = document.createElement('a')
284 link.href = url
285 link.download = filename
286 document.body.appendChild(link)
287 link.click()
288 document.body.removeChild(link)
289 URL.revokeObjectURL(url)
290}
291
292// 获取日期字符串(格式:YYYY-MM-DD)
293function getDateString(): string {

Callers 6

exportToCSVFunction · 0.85
exportToJSONFunction · 0.85
exportCompleteDataFunction · 0.85
exportReviewsDataFunction · 0.85
exportReviewsToMarkdownFunction · 0.85
exportEventsDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected