(filename, spec)
| 7 | const specsPath = path.join('frontend', 'categories') |
| 8 | |
| 9 | function writeSpec(filename, spec) { |
| 10 | // Omit undefined |
| 11 | // https://github.com/nodeca/js-yaml/issues/356#issuecomment-312430599 |
| 12 | const cleaned = JSON.parse(JSON.stringify(spec)) |
| 13 | |
| 14 | fs.writeFileSync( |
| 15 | filename, |
| 16 | yaml.dump(cleaned, { flowLevel: 5, forceQuotes: true }), |
| 17 | ) |
| 18 | } |
| 19 | |
| 20 | ;(async () => { |
| 21 | const definitions = await collectDefinitions() |