0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 14:12:40 +00:00

A little bit of cleanup and structure flattening

Fixes failed tests.
This commit is contained in:
David Bolack
2025-04-08 20:29:32 -05:00
parent 9f56d100aa
commit c6cd6e9864
2 changed files with 5 additions and 3 deletions

View File

@@ -177,7 +177,8 @@ const api = {
`${text}`;
}
const metadata = _.pick(brew, ['title', 'description', 'tags', 'systems', 'renderer', 'theme']);
metadata.snippets = brewSnippetsToJSON('brew_snippets', brew.snippets, null, false);
const snippetsArray = brewSnippetsToJSON('brew_snippets', brew.snippets, null, false).snippets;
metadata.snippets = snippetsArray.length > 0 ? snippetsArray : undefined;
text = `\`\`\`metadata\n` +
`${yaml.dump(metadata)}\n` +
`\`\`\`\n\n` +