{"name":"sort-object-keys","version":"1.1.1","description":"Sort an object's keys, including an optional key list","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/keithamus/sort-object-keys.git"},"keywords":["object","sort","keys"],"author":{"name":"Keith Cirkel","email":"npm@keithcirkel.co.uk","url":"http://keithcirkel.co.uk/"},"license":"MIT","bugs":{"url":"https://github.com/keithamus/sort-object-keys/issues"},"homepage":"https://github.com/keithamus/sort-object-keys#readme","gitHead":"fdeda65401e9f902af655ce28e83b84ab0eace3c","_id":"sort-object-keys@1.1.1","_shasum":"cc8ad9b461cd33833d0c5272e6be0e31a971a242","_from":".","_npmVersion":"3.3.3","_nodeVersion":"0.12.7","_npmUser":{"name":"keithamus","email":"npm@keithcirkel.co.uk"},"dist":{"shasum":"cc8ad9b461cd33833d0c5272e6be0e31a971a242","tarball":"http://registry-npm.ywwl.com/sort-object-keys/download/sort-object-keys-1.1.1.tgz","integrity":"sha512-h70ZMSgly75+bi++osqgW+j/Uz0EPvj1FWXb21IrkV7Nkh7ihLMt7nI27FaOG4QSEWzd8YYfnxXXOjSoIoaM3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDHOCtlCzz/iQRhWj8RInB4xVcIAkWAEFL+Jyax1grGNAiAGlKh1b7lVGVT7yaL7W8e22pO6GA384skhW86RWDSiQg=="}],"size":1264,"noattachment":false,"key":"/sort-object-keys/-/sort-object-keys-1.1.1.tgz"},"maintainers":[{"name":"keithamus","email":"npm@keithcirkel.co.uk"}],"directories":{},"readme":"# Sort Object\n\n\n\n[![Build Status](https://travis-ci.org/keithamus/sort-object-keys.svg)](https://travis-ci.org/keithamus/sort-object-keys)\n\nReturns a copy of an object with all keys sorted.\n\nThe second argument is optional and is used for ordering - to provide custom sorts. You can either pass an array containing ordered keys or a function to sort the keys (same signature as in [`Array.prototype.sort()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)).\n\n```js\nconst assert = require('assert');\nconst sortObject = require('sort-object-keys');\n\nassert.equal(JSON.stringify({\n  c: 1,\n  b: 1,\n  d: 1,\n  a: 1,\n}), JSON.stringify({\n  a: 1,\n  b: 1,\n  c: 1,\n  d: 1,\n}));\n\nassert.equal(JSON.stringify(sortObject({\n  c: 1,\n  b: 1,\n  d: 1,\n  a: 1,\n}, ['b', 'a', 'd', 'c'])), JSON.stringify({\n  b: 1,\n  a: 1,\n  d: 1,\n  c: 1,\n}));\n\nfunction removeKeyAncCompareIndex(keyA, keyB){\n  var a = parseInt(keyA.slice(4));\n  var b = parseInt(keyB.slice(4));\n  return a - b;\n}\n\nassert.equal(JSON.stringify(sortObject({\n  \"key-1\": 1,\n  \"key-3\": 1,\n  \"key-10\": 1,\n  \"key-2\": 1,\n}, removeKeyAncCompareIndex)), JSON.stringify({\n  \"key-1\": 1,\n  \"key-2\": 1,\n  \"key-3\": 1,\n  \"key-10\": 1,\n}));\n```\n","publish_time":1449058541360,"_cnpm_publish_time":1449058541360,"dist-tags":{"latest":"2.1.0"}}