(text: string)
| 18 | dayjs.locale('zh-cn'); |
| 19 | |
| 20 | // 必需工具函数 |
| 21 | // 解析 namebeta.com 的 SSE 流式响应,返回各事件对象 |
| 22 | function parseSSEResponse(raw: string): Array<{type: string; data: any}> { |
| 23 | const events: Array<{type: string; data: any}> = []; |
| 24 | for (const line of raw.split('\n')) { |
| 25 | const trimmed = line.trim(); |
| 26 | if (!trimmed.startsWith('data: ')) continue; |
| 27 | try { |
no outgoing calls
no test coverage detected