Skip to content

Commit 1a514a1

Browse files
committed
Fix default removal
Closes GH-1.
1 parent cdc2cfe commit 1a514a1

File tree

4 files changed

+199
-179
lines changed

4 files changed

+199
-179
lines changed

build.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ function onbody(doc) {
3232

3333
visit(fromXml(doc), 'element', onelement)
3434

35+
// Sort by length first, then alphabetical.
36+
defaults.sort(sort)
37+
3538
write('defaults', defaults)
3639
write('fields', fields)
3740
write('many', many)
@@ -158,3 +161,7 @@ function write(name, values) {
158161
JSON.stringify(values, null, 2) + '\n'
159162
)
160163
}
164+
165+
function sort(a, b) {
166+
return b.length - a.length || a.localeCompare(b)
167+
}

0 commit comments

Comments
 (0)