MCPcopy
hub / github.com/badges/shields / writeSpec

Function writeSpec

scripts/export-openapi-cli.js:9–18  ·  view source on GitHub ↗
(filename, spec)

Source from the content-addressed store, hash-verified

7const specsPath = path.join('frontend', 'categories')
8
9function 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()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected