$ npm install sort-keys-length
Sort object keys by length
$ npm install sort-keys-length
const 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.
Type: Object
Object to sort.
Type: Object
Type: boolean
Default: false
Recursively sort keys.
MIT © Kevin Mårtensson
© 2010 - cnpmjs.org x YWFE | Home | YWFE