sort-keys-length

Sort objecy keys by length

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
sort-keys-length
1102.0.07 years ago9 years agoMinified + gzip package size for sort-keys-length in KB

Readme

sort-keys-length Build Status
Sort object keys by length

Install

$ npm install sort-keys-length

Usage

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'}

API

sortKeysLength.asc(object, options)

Ascending sort.

sortKeysLength.desc(object, options)

Descending sort.

object

Type: Object
Object to sort.

options

Type: Object
deep
Type: boolean
Default: false
Recursively sort keys.

License

MIT © Kevin Mårtensson