{"name":"sort-keys","version":"5.1.0","description":"Sort the keys of an object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/sort-keys.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","sideEffects":false,"engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["sort","object","keys","key","stable","deterministic","deep","recursive","recursively","array","sorted","sorting"],"dependencies":{"is-plain-obj":"^4.0.0"},"devDependencies":{"ava":"^6.1.3","tsd":"^0.31.2","xo":"^0.59.3"},"_id":"sort-keys@5.1.0","gitHead":"74b6172ef0f25060cc05dead79f4ffb1cd979556","bugs":{"url":"https://github.com/sindresorhus/sort-keys/issues"},"homepage":"https://github.com/sindresorhus/sort-keys#readme","_nodeVersion":"18.20.2","_npmVersion":"10.6.0","dist":{"integrity":"sha512-aSbHV0DaBcr7u0PVHXzM6NbZNAtrr9sF6+Qfs9UUVG7Ll3jQ6hHi8F/xqIIcn2rvIVbr0v/2zyjSdwSV47AgLQ==","shasum":"50a3f3d1ad3c5a76d043e0aeeba7299241e9aa5c","tarball":"http://registry-npm.ywwl.com/sort-keys/download/sort-keys-5.1.0.tgz","fileCount":5,"unpackedSize":5456,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUG+PJoHkFTxcxOEtkl+8eWQ+D1uxkf2LiF9+NoyyXogIgE7dh6kPExz+EgiCjQfAINUa7tHp/3eFe2acC5es9XiI="}],"size":2351,"noattachment":false,"key":"/sort-keys/-/sort-keys-5.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sort-keys_5.1.0_1725636017460_0.834174920846354"},"_hasShrinkwrap":false,"readme":"# sort-keys\n\n> Sort the keys of an object\n\nUseful to get a deterministically ordered object, as the order of keys can vary between engines.\n\n## Install\n\n```sh\nnpm install sort-keys\n```\n\n## Usage\n\n```js\nimport sortKeys from 'sort-keys';\n\nsortKeys({c: 0, a: 0, b: 0});\n//=> {a: 0, b: 0, c: 0}\n\nsortKeys({b: {b: 0, a: 0}, a: 0}, {deep: true});\n//=> {a: 0, b: {a: 0, b: 0}}\n\nsortKeys({b: [{b: 0, a: 0}], a: 0}, {deep: true});\n//=> {a: 0, b: [{a: 0, b: 0}]}\n\nsortKeys({c: 0, a: 0, b: 0}, {\n\tcompare: (a, b) => -a.localeCompare(b)\n});\n//=> {c: 0, b: 0, a: 0}\n\nsortKeys([{b: 0, a:2}], {deep: true});\n//=> [{a: 2, b: 0}]\n```\n\n## API\n\n### sortKeys(object, options?)\n\nReturns a new object with sorted keys.\n\n#### object\n\nType: `object | Array`\n\n#### options\n\nType: `object`\n\n##### deep\n\nType: `boolean`\\\nDefault: `false`\n\nRecursively sort keys, including keys of objects inside arrays.\n\n##### compare\n\nType: `Function`\n\n[Compare function.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\n","publish_time":1725636017582,"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_cnpm_publish_time":1725636017582,"dist-tags":{"latest":"6.0.1"}}