bmad-viewer 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -26,12 +26,14 @@ export function parseYaml(filePath) {
|
|
|
26
26
|
*/
|
|
27
27
|
export function parseYamlContent(content, source = 'unknown') {
|
|
28
28
|
try {
|
|
29
|
-
const
|
|
29
|
+
const docs = yaml.loadAll(content);
|
|
30
|
+
const nonNull = docs.filter(d => d !== undefined && d !== null);
|
|
30
31
|
|
|
31
|
-
if (
|
|
32
|
+
if (nonNull.length === 0) {
|
|
32
33
|
return createResult(null, [], [`Empty YAML content in ${source}`]);
|
|
33
34
|
}
|
|
34
35
|
|
|
36
|
+
const data = nonNull.length === 1 ? nonNull[0] : Object.assign({}, ...nonNull);
|
|
35
37
|
return createResult(data, [], []);
|
|
36
38
|
} catch (error) {
|
|
37
39
|
const warnings = [`Failed to parse ${source}`];
|