MCPcopy Create free account
hub / github.com/EdgeTX/buddy / parseYamlFile

Function parseYamlFile

src/shared/zipParser.ts:44–64  ·  view source on GitHub ↗
(
  base64Data: string,
  fileName: string
)

Source from the content-addressed store, hash-verified

42}
43
44export function parseYamlFile(
45 base64Data: string,
46 fileName: string
47): ParsedYamlFile {
48 try {
49 const arrayBuffer = base64ArrayBuffer.decode(base64Data);
50 const buffer = Buffer.from(arrayBuffer);
51 const text = buffer.toString("utf-8");
52 const content = yaml.parse(text) as Record<string, unknown>;
53
54 // Extract model name from file (remove .yml extension)
55 const modelName = fileName.replace(".yml", "");
56
57 return {
58 fileName: modelName,
59 content,
60 };
61 } catch (error) {
62 throw new Error(`Failed to parse YAML file: ${fileName}`);
63 }
64}

Callers 3

processFileFunction · 0.90
BackupUploadAreaFunction · 0.90
zipParser.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected