diff --git a/lib/formatter.js b/lib/formatter.js index dd90dbb..3a6fb72 100644 --- a/lib/formatter.js +++ b/lib/formatter.js @@ -6,7 +6,9 @@ function sortBy(cb) { return (v1, v2) => { v1 = cb(v1); v2 = cb(v2); - return v1 < v2 ? -1 : v1 > v2 ? 1 : 0; + if (v1 < v2) return -1; + if (v1 > v2) return 1; + return 0; }; } @@ -25,8 +27,8 @@ function createSortFunction(positionless, sortByPosition) { if (sortByPosition) { return (v1, v2) => ( sortFunction(v1, v2) || - sortBy((m) => m.line || "")(v1, v2) || - sortBy((m) => m.column || "")(v1, v2)); + sortBy((m) => m.line || '')(v1, v2) || + sortBy((m) => m.column || '')(v1, v2)); } return sortFunction;