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

Function parseFileWithFormat

packages/parser/src/index.ts:144–156  ·  view source on GitHub ↗
(
  formatId: string,
  options: ParseOptions
)

Source from the content-addressed store, hash-verified

142 * @yields 解析事件流
143 */
144export async function* parseFileWithFormat(
145 formatId: string,
146 options: ParseOptions
147): AsyncGenerator<ParseEvent, void, unknown> {
148 const parser = sniffer.getParserById(formatId)
149 if (!parser) {
150 yield { type: 'error', data: new Error(`未知的格式 ID: ${formatId}`) }
151 return
152 }
153
154 console.log(`[Parser V2] Using parser (explicit): ${parser.feature.name}`)
155 yield* parser.parse(options)
156}
157
158/**
159 * 同步解析文件(收集所有事件为完整结果)

Callers 1

streamParseFileFunction · 0.85

Calls 2

getParserByIdMethod · 0.80
parseMethod · 0.80

Tested by

no test coverage detected