Skip to content

Commit

Permalink
Fix default removal
Browse files Browse the repository at this point in the history
Closes GH-1.
  • Loading branch information
wooorm committed Jul 24, 2020
1 parent cdc2cfe commit 1a514a1
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 179 deletions.
7 changes: 7 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ function onbody(doc) {

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

// Sort by length first, then alphabetical.
defaults.sort(sort)

write('defaults', defaults)
write('fields', fields)
write('many', many)
Expand Down Expand Up @@ -158,3 +161,7 @@ function write(name, values) {
JSON.stringify(values, null, 2) + '\n'
)
}

function sort(a, b) {
return b.length - a.length || a.localeCompare(b)
}
Loading

0 comments on commit 1a514a1

Please sign in to comment.