{"name":"sort-object-keys","version":"1.1.2","description":"Sort an object's keys, including an optional key list","keywords":["keys","object","sort"],"homepage":"https://github.com/keithamus/sort-object-keys#readme","bugs":{"url":"https://github.com/keithamus/sort-object-keys/issues"},"license":"MIT","author":{"name":"Keith Cirkel","email":"npm@keithcirkel.co.uk","url":"http://keithcirkel.co.uk/"},"files":["index.js"],"main":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/keithamus/sort-object-keys.git"},"scripts":{"semantic-release":"travis-after-all && semantic-release pre && npm publish && semantic-release post","test":"node test.js"},"devDependencies":{"semantic-release":"^4.3.5","travis-after-all":"^1.4.4"},"gitHead":"c095403bb657f28385b7c72264babc3d22c560d4","_id":"sort-object-keys@1.1.2","_shasum":"d3a6c48dc2ac97e6bc94367696e03f6d09d37952","_from":".","_npmVersion":"2.14.9","_nodeVersion":"0.12.9","_npmUser":{"name":"keithamus","email":"npm@keithcirkel.co.uk"},"dist":{"shasum":"d3a6c48dc2ac97e6bc94367696e03f6d09d37952","tarball":"http://registry-npm.ywwl.com/sort-object-keys/download/sort-object-keys-1.1.2.tgz","integrity":"sha512-IWz4OstR6UZsK9dEhw/J99r+LYbm6TNSY6yPvldttFJkFj/1vUvzCmw82CeeCS/aHxdm1QUL+5K96Q2ssplnFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHiSAqKztEm61f5Ta+O/Pw1LwXOSRNZTW/MrHLFNdyQDAiAykh0YCG3+UgjtdcZRaCrWrTRSrt6B03gqHSOJBjpV0Q=="}],"size":1223,"noattachment":false,"key":"/sort-object-keys/-/sort-object-keys-1.1.2.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":1450095183229,"_cnpm_publish_time":1450095183229,"dist-tags":{"latest":"2.1.0"}}