MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / parseLine

Function parseLine

packages/parser/src/formats/chatlab-jsonl.ts:94–106  ·  view source on GitHub ↗

* 解析单行 JSONL

(line: string)

Source from the content-addressed store, hash-verified

92 * 解析单行 JSONL
93 */
94function parseLine(line: string): JsonlLine | null {
95 const trimmed = line.trim()
96 if (!trimmed || trimmed.startsWith('#')) {
97 // 空行或注释行,跳过
98 return null
99 }
100 try {
101 return JSON.parse(trimmed) as JsonlLine
102 } catch {
103 // 解析失败,跳过该行
104 return null
105 }
106}
107
108// ==================== 特征定义 ====================
109

Callers 1

parseChatLabJsonlFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected