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

Function parseFile

packages/parser/src/index.ts:127–136  ·  view source on GitHub ↗
(options: ParseOptions)

Source from the content-addressed store, hash-verified

125 * @yields 解析事件流
126 */
127export async function* parseFile(options: ParseOptions): AsyncGenerator<ParseEvent, void, unknown> {
128 const parser = sniffer.getParser(options.filePath)
129 if (!parser) {
130 yield { type: 'error', data: new Error(`无法识别文件格式: ${options.filePath}`) }
131 return
132 }
133
134 console.log(`[Parser V2] Using parser: ${parser.feature.name}`)
135 yield* parser.parse(options)
136}
137
138/**
139 * 使用指定格式解析文件(用于 fallback 机制)

Callers 3

parseFileSyncFunction · 0.85
parseFileInfoFunction · 0.85
streamParseFileFunction · 0.85

Calls 2

getParserMethod · 0.80
parseMethod · 0.80

Tested by

no test coverage detected