Skip to content

Commit d7c6b0c

Browse files
committed
Add generated schema
1 parent 9482307 commit d7c6b0c

File tree

3 files changed

+167
-166
lines changed

3 files changed

+167
-166
lines changed

compiler/src/model/json-spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,13 @@ export default function buildJsonSpec (): Map<string, JsonSpec> {
6767
const files = readdirSync(jsonSpecPath)
6868
.filter(file => file.endsWith('.json'))
6969

70-
const map = new Map()
70+
const map: Map<string, JsonSpec> = new Map()
7171
for (const file of files) {
7272
const json = require(join(jsonSpecPath, file))
7373
const name = Object.keys(json)[0]
7474
map.set(name, json[name])
7575
}
7676

77-
return map
77+
// Ensure deterministic ordering
78+
return new Map([...map.entries()].sort((a, b) => a[0].localeCompare(b[0])))
7879
}

0 commit comments

Comments
 (0)