Skip to content

Commit

Permalink
Add generated schema
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd committed Jun 18, 2024
1 parent 9482307 commit d7c6b0c
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 166 deletions.
5 changes: 3 additions & 2 deletions compiler/src/model/json-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ export default function buildJsonSpec (): Map<string, JsonSpec> {
const files = readdirSync(jsonSpecPath)
.filter(file => file.endsWith('.json'))

const map = new Map()
const map: Map<string, JsonSpec> = new Map()
for (const file of files) {
const json = require(join(jsonSpecPath, file))
const name = Object.keys(json)[0]
map.set(name, json[name])
}

return map
// Ensure deterministic ordering
return new Map([...map.entries()].sort((a, b) => a[0].localeCompare(b[0])))
}
Loading

0 comments on commit d7c6b0c

Please sign in to comment.