Permalink
Browse files

Fix group sorting

Since 2.0 data upgrade, the `group` key is no more an array of arrays,
it's just a flat array. The sorter was not up-to-date, but we did not
notice it since it was in fact sorting on the first letter of the group
name, which will look fine in most cases.

A test fixture was also wrong about this...
  • Loading branch information...
valeriangalliat committed Feb 13, 2015
1 parent b1eb735 commit e506be01df1bdbb378cdfa015b221b8ff72843d0
Showing with 171 additions and 171 deletions.
  1. +1 −1 src/sorter.js
  2. +170 −170 test/data/expected.json
View
@@ -4,7 +4,7 @@
*/
export default function sort(data) {
return data.sort((a, b) => {
- return compare(a.group[0][0].toLowerCase(), b.group[0][0].toLowerCase()) ||
+ return compare(a.group[0].toLowerCase(), b.group[0].toLowerCase()) ||
compare(a.file.path, b.file.path) ||
compare(a.context.line.start, b.context.line.start);
});
Oops, something went wrong.

0 comments on commit e506be0

Please sign in to comment.