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

Function exportToJSON

src/services/exportService.ts:69–80  ·  view source on GitHub ↗
(positions: Position[], summary: ProfitSummary)

Source from the content-addressed store, hash-verified

67
68// 导出为 JSON(用于持久化)
69export function exportToJSON(positions: Position[], summary: ProfitSummary): void {
70 const data: ExportData = {
71 version: '1.0.0',
72 exportTime: Date.now(),
73 positions,
74 summary,
75 }
76
77 const jsonContent = JSON.stringify(data, null, 2)
78
79 downloadFile(jsonContent, `持仓备份_${getDateString()}.json`, 'application/json')
80}
81
82// 导出完整数据(包含持仓、复盘和事件)
83export async function exportCompleteData(positions: Position[], summary: ProfitSummary): Promise<void> {

Callers 1

handleExportJSONFunction · 0.90

Calls 2

downloadFileFunction · 0.85
getDateStringFunction · 0.85

Tested by

no test coverage detected