Skip to content

Commit a306fdc

Browse files
committed
Add generated schema
1 parent 9482307 commit a306fdc

File tree

4 files changed

+167
-166
lines changed

4 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
}

compiler/src/model/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ export function hoistTypeAnnotations (type: model.TypeDefinition, jsDocs: JSDoc[
731731
'@codegen_names must have the number of items as the union definition'
732732
)
733733
} else if (tag === 'es_quirk') {
734-
type.esQuirk = value
734+
type.esQuirk = value.replace(/\r/g, '')
735735
} else {
736736
assert(jsDocs, false, `Unhandled tag: '${tag}' with value: '${value}' on type ${type.name.name}`)
737737
}

0 commit comments

Comments
 (0)