Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Aug 1, 2020
1 parent e784086 commit 294f3e3
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/convert.ts
Expand Up @@ -125,7 +125,21 @@ export function convertRoot(node: Root, code: string): YAMLProgram {

column++
}
tokens.sort((a, b) => a.range[0] - b.range[0])
tokens.sort((a, b) => {
if (a.range[0] > b.range[0]) {
return 1
}
if (a.range[0] < b.range[0]) {
return -1
}
if (a.range[1] > b.range[1]) {
return 1
}
if (a.range[1] < b.range[1]) {
return -1
}
return 0
})
return ast

/**
Expand Down

0 comments on commit 294f3e3

Please sign in to comment.