Skip to content

Commit

Permalink
fix(configManager): 🐛Fix gitmoji stat order
Browse files Browse the repository at this point in the history
  • Loading branch information
vivaxy committed Feb 5, 2017
1 parent f4631d3 commit a21ffbe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/configManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const readListByStatOrder = () => {
const userConfig = read();
const configList = userConfig.gitmojis;
configList.sort((prev, next) => {
return prev.stat < next.stat;
return next.stat - prev.stat;
});
return configList;
};
8 changes: 8 additions & 0 deletions test/lib/_configManager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @since 2017-02-05 12:52
* @author vivaxy
*/

import { readListByStatOrder } from '../../lib/configManager';

console.log(readListByStatOrder());
8 changes: 8 additions & 0 deletions test/lib/configManager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @since 2017-02-05 12:49
* @author vivaxy
*/

require('babel-polyfill');
require('babel-register')();
require('./_configManager');

0 comments on commit a21ffbe

Please sign in to comment.