MCPcopy
hub / github.com/ZToolsCenter/ZTools / serializeArgs

Method serializeArgs

src/main/core/logCollector.ts:195–205  ·  view source on GitHub ↗

* 序列化日志参数为字符串

(data: any[], cleanMessage: string)

Source from the content-addressed store, hash-verified

193 * 序列化日志参数为字符串
194 */
195 private serializeArgs(data: any[], cleanMessage: string): string {
196 // 如果提取了 source 前缀,使用 cleanMessage + 剩余参数
197 if (cleanMessage) {
198 const rest = data.slice(1)
199 if (rest.length === 0) return cleanMessage
200 return cleanMessage + ' ' + rest.map((arg) => this.stringify(arg)).join(' ')
201 }
202
203 // 无前缀,直接序列化全部参数
204 return data.map((arg) => this.stringify(arg)).join(' ')
205 }
206
207 /**
208 * 安全序列化单个参数

Callers 1

collectEntryMethod · 0.95

Calls 1

stringifyMethod · 0.95

Tested by

no test coverage detected