guilmour 4d48d7b520 Version 0.1 | 6 yıl önce | |
---|---|---|
.. | ||
LICENSE.md | 6 yıl önce | |
README.md | 6 yıl önce | |
index.js | 6 yıl önce |
Sort object keys by length
$ npm install --save sort-keys-length
var sortKeysLength = require('sort-keys-length');
sortKeysLength.asc({ ab: 'x', a: 'y', abc: 'z' });
//=> { a: 'y', ab: 'x', abc: 'z' }
sortKeysLength.desc({ ab: 'x', a: 'y', abc: 'z' });
//=> { abc: 'z', ab: 'x', a: 'y' }
Ascending sort.
Descending sort.
MIT © Kevin Mårtensson