Simple module to sort objects recursively by its keys
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test CS. Jun 28, 2014
.editorconfig Update .editorconfig (made with screpto) Jan 2, 2016
.gitignore Initial commit. May 28, 2014
.jshintrc Initial commit. May 28, 2014
.travis.yml Add more nodejs targets. Jan 2, 2016
LICENSE Update LICENSE May 28, 2014
README.md Update README.md Jun 6, 2017
bower.json Bump version. Jan 2, 2016
index.js Overall project update. Jan 2, 2016
index.umd.js Build. Apr 3, 2017
package.json Release 1.0.2 Apr 3, 2017

README.md

deep-sort-object

NPM version Downloads Build Status Dependency status Dev Dependency status Greenkeeper badge

Simple module to sort objects recursively by its keys.

Installation

$ npm install deep-sort-object - NPM
$ bower install deep-sort-object - bower

The browser file is named index.umd.js which supports CommonJS, AMD and globals (deepForEach). If you want to run this module on old browsers, you must include es5-shim.

Usage

The example bellow is based on nodejs.

var sortobject = require('deep-sort-object');

sortobject({
    'z': 'foo',
    'b': 'bar',
    'a': [
        {
            'z': 'foo',
            'b': 'bar'
        }
    ]
});

/*
{
    'a': [
        {
            'b': 'bar',
            'z': 'foo'
        }
    ],
    'b': 'bar',
    'z': 'foo'
});
*/

Tests

$ npm test

License

Released under the MIT License.