MCPcopy Create free account
hub / github.com/massCodeIO/massCode / readYaml

Function readYaml

src/main/http/import/opencollection.ts:86–94  ·  view source on GitHub ↗
(file: HttpImportFile, warnings: HttpImportWarning[])

Source from the content-addressed store, hash-verified

84}
85
86function readYaml(file: HttpImportFile, warnings: HttpImportWarning[]) {
87 try {
88 return yaml.load(file.content) as unknown
89 }
90 catch {
91 addWarning(warnings, file.name, 'Invalid YAML skipped')
92 return null
93 }
94}
95
96function getInfo(raw: unknown): UnknownRecord {
97 return isRecord(raw) && isRecord(raw.info) ? raw.info : {}

Callers 1

parseOpenCollectionFilesFunction · 0.85

Calls 1

addWarningFunction · 0.90

Tested by

no test coverage detected