{"_id":"compare-func","_rev":"4216","name":"compare-func","description":"Get a compare function for array to sort","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"time":{"modified":"2021-06-03T09:56:28.000Z","created":"2015-04-03T13:03:01.080Z","2.0.0":"2020-05-15T13:35:21.878Z","1.3.4":"2020-05-15T13:32:33.317Z","1.3.3":"2020-05-15T13:27:19.409Z","1.3.2":"2016-06-30T07:31:12.949Z","1.3.1":"2015-06-14T23:37:18.850Z","1.3.0":"2015-06-13T05:17:37.438Z","1.2.0":"2015-05-04T07:15:33.336Z","1.1.0":"2015-05-02T03:05:18.162Z","1.0.2":"2015-04-03T14:04:51.117Z","1.0.1":"2015-04-03T13:14:17.080Z","1.0.0":"2015-04-03T13:10:58.110Z","0.0.0":"2015-04-03T13:03:01.080Z"},"users":{"rocket0191":true},"author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"git+https://github.com/stevemao/compare-func.git"},"versions":{"2.0.0":{"name":"compare-func","version":"2.0.0","description":"Get a compare function for array to sort","homepage":"https://github.com/stevemao/compare-func","author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"git+https://github.com/stevemao/compare-func.git"},"license":"MIT","keywords":["compare-func","arr","array","by","compare","dot","get","obj","object","prop","property","sort","sorting"],"dependencies":{"array-ify":"^1.0.0","dot-prop":"^5.1.0"},"devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.4.4","jscs":"^3.0.5","jshint":"^2.7.0","mocha":"^7.1.2"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec && rm -rf ./coverage","lint":"jshint *.js --exclude node_modules && jscs *.js","test":"npm run-script lint && mocha"},"gitHead":"ea273199551fcb4fdfd6c34a37cb263e5117825d","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"_id":"compare-func@2.0.0","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"shasum":"fb65e75edbddfd2e568554e8b5b05fff7a51fcb3","size":2171,"noattachment":false,"key":"/compare-func/-/compare-func-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/compare-func/download/compare-func-2.0.0.tgz"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"_npmUser":{"name":"stevemao","email":"maochenyan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compare-func_2.0.0_1589549721737_0.64007997733769"},"_hasShrinkwrap":false,"publish_time":1589549721878,"_cnpm_publish_time":1589549721878},"1.3.4":{"name":"compare-func","version":"1.3.4","description":"Get a compare function for array to sort","homepage":"https://github.com/stevemao/compare-func","author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"git+https://github.com/stevemao/compare-func.git"},"license":"MIT","keywords":["compare-func","arr","array","by","compare","dot","get","obj","object","prop","property","sort","sorting"],"dependencies":{"array-ify":"^1.0.0","dot-prop":"^3.0.0"},"devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.4.4","jscs":"^3.0.5","jshint":"^2.7.0","mocha":"^2.5.1"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec && rm -rf ./coverage","lint":"jshint *.js --exclude node_modules && jscs *.js","test":"npm run-script lint && mocha"},"gitHead":"a04010a32bd7aaf895771016ea21d8c190af0f29","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"_id":"compare-func@1.3.4","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"shasum":"6b07c4c5e8341119baf44578085bda0f4a823516","size":2170,"noattachment":false,"key":"/compare-func/-/compare-func-1.3.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/compare-func/download/compare-func-1.3.4.tgz"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"_npmUser":{"name":"stevemao","email":"maochenyan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compare-func_1.3.4_1589549553194_0.9922857999180084"},"_hasShrinkwrap":false,"publish_time":1589549553317,"_cnpm_publish_time":1589549553317},"1.3.3":{"name":"compare-func","version":"1.3.3","description":"Get a compare function for array to sort","homepage":"https://github.com/stevemao/compare-func","author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"git+https://github.com/stevemao/compare-func.git"},"license":"MIT","keywords":["compare-func","arr","array","by","compare","dot","get","obj","object","prop","property","sort","sorting"],"dependencies":{"array-ify":"^1.0.0","dot-prop":"^5.1.0"},"devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.4.4","jscs":"^3.0.5","jshint":"^2.7.0","mocha":"^2.5.1"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec && rm -rf ./coverage","lint":"jshint *.js --exclude node_modules && jscs *.js","test":"npm run-script lint && mocha"},"gitHead":"ba4a5e0c416b4a65f37ffd75f05c17fd8bf069c0","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"_id":"compare-func@1.3.3","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"shasum":"eec550dcc84c78c037517626c79ce3abba1c1b5b","size":2171,"noattachment":false,"key":"/compare-func/-/compare-func-1.3.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/compare-func/download/compare-func-1.3.3.tgz"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"_npmUser":{"name":"stevemao","email":"maochenyan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compare-func_1.3.3_1589549239237_0.4028682486255428"},"_hasShrinkwrap":false,"publish_time":1589549239409,"_cnpm_publish_time":1589549239409},"1.3.2":{"name":"compare-func","version":"1.3.2","description":"Get a compare function for array to sort","homepage":"https://github.com/stevemao/compare-func","author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"git+https://github.com/stevemao/compare-func.git"},"license":"MIT","files":["index.js"],"keywords":["compare-func","arr","array","by","compare","dot","get","obj","object","prop","property","sort","sorting"],"dependencies":{"array-ify":"^1.0.0","dot-prop":"^3.0.0"},"devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.4.4","jscs":"^3.0.5","jshint":"^2.7.0","mocha":"*"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec && rm -rf ./coverage","lint":"jshint *.js --exclude node_modules && jscs *.js","test":"npm run-script lint && mocha"},"gitHead":"8b3d32bc2540aae38a000205ea3345a77e0e1b50","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"_id":"compare-func@1.3.2","_shasum":"99dd0ba457e1f9bc722b12c08ec33eeab31fa648","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.4","_npmUser":{"name":"stevemao","email":"maochenyan@gmail.com"},"dist":{"shasum":"99dd0ba457e1f9bc722b12c08ec33eeab31fa648","size":1510,"noattachment":false,"key":"/compare-func/-/compare-func-1.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/compare-func/download/compare-func-1.3.2.tgz"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/compare-func-1.3.2.tgz_1467271872418_0.13966840622015297"},"directories":{},"publish_time":1467271872949,"_cnpm_publish_time":1467271872949,"_hasShrinkwrap":false},"1.3.1":{"name":"compare-func","version":"1.3.1","description":"Get a compare function for array to sort","homepage":"https://github.com/stevemao/compare-func","author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"git+https://github.com/stevemao/compare-func.git"},"license":"MIT","files":["index.js"],"keywords":["compare-func","arr","array","by","compare","dot","get","obj","object","prop","property","sort","sorting"],"dependencies":{"array-ify":"^1.0.0","dot-prop":"^2.0.0"},"devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.3.13","jscs":"^1.13.1","jshint":"^2.7.0","mocha":"*"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec && rm -rf ./coverage","lint":"jshint *.js --exclude node_modules && jscs *.js","test":"npm run-script lint && mocha"},"gitHead":"9cd7929d9b2649438a6c02be25a204ace87ee80d","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"_id":"compare-func@1.3.1","_shasum":"8594f0ffdf23fc021fa51761790be9bc272d23af","_from":".","_npmVersion":"2.9.1","_nodeVersion":"0.12.2","_npmUser":{"name":"stevemao","email":"steve.mao@healthinteract.com.au"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"dist":{"shasum":"8594f0ffdf23fc021fa51761790be9bc272d23af","size":1501,"noattachment":false,"key":"/compare-func/-/compare-func-1.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/compare-func/download/compare-func-1.3.1.tgz"},"directories":{},"publish_time":1434325038850,"_cnpm_publish_time":1434325038850,"_hasShrinkwrap":false},"1.3.0":{"name":"compare-func","version":"1.3.0","description":"Get a compare function for array to sort","homepage":"https://github.com/stevemao/compare-func","author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"git+https://github.com/stevemao/compare-func.git"},"license":"MIT","files":["index.js"],"keywords":["compare-func","arr","array","by","compare","dot","get","obj","object","prop","property","sort","sorting"],"dependencies":{"dot-prop":"^2.0.0"},"devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.3.13","jscs":"^1.13.1","jshint":"^2.7.0","mocha":"*"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec && rm -rf ./coverage","lint":"jshint *.js --exclude node_modules && jscs *.js","test":"npm run-script lint && mocha"},"gitHead":"9502a2717428a24acc41feb8d3092da1b11e9121","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"_id":"compare-func@1.3.0","_shasum":"3752e5f11639d379c12499e716fb36e3fc86d9c5","_from":".","_npmVersion":"2.9.1","_nodeVersion":"0.12.2","_npmUser":{"name":"stevemao","email":"steve.mao@healthinteract.com.au"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"dist":{"shasum":"3752e5f11639d379c12499e716fb36e3fc86d9c5","size":1505,"noattachment":false,"key":"/compare-func/-/compare-func-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/compare-func/download/compare-func-1.3.0.tgz"},"directories":{},"publish_time":1434172657438,"_cnpm_publish_time":1434172657438,"_hasShrinkwrap":false},"1.2.0":{"name":"compare-func","version":"1.2.0","description":"Get a compare function for array to sort","homepage":"https://github.com/stevemao/compare-func","author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"git+https://github.com/stevemao/compare-func.git"},"license":"MIT","files":["index.js"],"keywords":["compare-func","arr","array","by","compare","dot","get","obj","object","prop","property","sort","sorting"],"dependencies":{"clone":"^1.0.2","dot-prop":"^2.0.0"},"devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.3.13","jscs":"^1.13.1","jshint":"^2.7.0","mocha":"*"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec && rm -rf ./coverage","lint":"jshint *.js --exclude node_modules && jscs *.js","test":"npm run-script lint && mocha"},"gitHead":"a0aa0985a95383745b6a1b48f375625ece0d7479","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"_id":"compare-func@1.2.0","_shasum":"5df100650f315ad3c8d314603ecd7cf8261174fc","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.12.2","_npmUser":{"name":"stevemao","email":"steve.mao@healthinteract.com.au"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"dist":{"shasum":"5df100650f315ad3c8d314603ecd7cf8261174fc","size":1531,"noattachment":false,"key":"/compare-func/-/compare-func-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/compare-func/download/compare-func-1.2.0.tgz"},"directories":{},"publish_time":1430723733336,"_cnpm_publish_time":1430723733336,"_hasShrinkwrap":false},"1.1.0":{"name":"compare-func","version":"1.1.0","description":"Get a compare function for array to sort","homepage":"https://github.com/stevemao/compare-func","author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"git+https://github.com/stevemao/compare-func.git"},"license":"MIT","files":["index.js"],"keywords":["compare-func","arr","array","by","compare","dot","get","obj","object","prop","property","sort","sorting"],"dependencies":{"dot-prop":"^2.0.0","lodash":"^3.8.0"},"devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.3.13","jscs":"^1.13.1","jshint":"^2.7.0","mocha":"*"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec && rm -rf ./coverage","lint":"jshint *.js --exclude node_modules && jscs *.js","test":"npm run-script lint && mocha"},"gitHead":"7d2156e05227a810902a5e31e14ba9dec6b6672b","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"_id":"compare-func@1.1.0","_shasum":"6f89f6ea86abc93678411063351d9632cccb41b5","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.12.2","_npmUser":{"name":"stevemao","email":"steve.mao@healthinteract.com.au"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"dist":{"shasum":"6f89f6ea86abc93678411063351d9632cccb41b5","size":1538,"noattachment":false,"key":"/compare-func/-/compare-func-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/compare-func/download/compare-func-1.1.0.tgz"},"directories":{},"publish_time":1430535918162,"_cnpm_publish_time":1430535918162,"_hasShrinkwrap":false},"1.0.2":{"name":"compare-func","version":"1.0.2","description":"Get a compare function for array to sort","homepage":"https://github.com/stevemao/compare-func","author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"https://github.com/stevemao/compare-func"},"license":"MIT","files":["index.js"],"keywords":["compare-func","arr","array","by","compare","dot","get","obj","object","prop","property","sort","sorting"],"dependencies":{"dot-prop":"^1.0.1","lodash":"^3.6.0"},"devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.3.8","jscs":"^1.11.3","jshint":"^2.6.3","mocha":"*"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec && rm -rf ./coverage","lint":"jshint *.js --exclude node_modules && jscs *.js","test":"npm run-script lint && mocha"},"gitHead":"d5a9d8c3783dd2be03b178f2f7a4eb0e67cf723c","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"_id":"compare-func@1.0.2","_shasum":"9334f3a918f7f0e5ffc39866e0f74ac9c3959723","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.0","_npmUser":{"name":"stevemao","email":"steve.mao@healthinteract.com.au"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"dist":{"shasum":"9334f3a918f7f0e5ffc39866e0f74ac9c3959723","size":1503,"noattachment":false,"key":"/compare-func/-/compare-func-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/compare-func/download/compare-func-1.0.2.tgz"},"directories":{},"publish_time":1428069891117,"_cnpm_publish_time":1428069891117,"_hasShrinkwrap":false},"1.0.1":{"name":"compare-func","version":"1.0.1","description":"Get a compare function for array to sort","homepage":"https://github.com/stevemao/compare-func","author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"https://github.com/stevemao/compare-func"},"license":"MIT","files":["index.js"],"keywords":["compare-func","arr","array","by","compare","dot","get","obj","object","prop","property","sort","sorting"],"dependencies":{"dot-prop":"^1.0.1","lodash.clonedeep":"^3.0.0","lodash.foreach":"^3.0.2"},"devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.3.8","jscs":"^1.11.3","jshint":"^2.6.3","mocha":"*"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec && rm -rf ./coverage","lint":"jshint *.js --exclude node_modules && jscs *.js","test":"npm run-script lint && mocha"},"gitHead":"cd7e6d55284b98138cbb33455709dbe4c1548b6e","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"_id":"compare-func@1.0.1","_shasum":"a16acd0857f0afa395e653ed6f77f51a6028a824","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.0","_npmUser":{"name":"stevemao","email":"steve.mao@healthinteract.com.au"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"dist":{"shasum":"a16acd0857f0afa395e653ed6f77f51a6028a824","size":1538,"noattachment":false,"key":"/compare-func/-/compare-func-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/compare-func/download/compare-func-1.0.1.tgz"},"directories":{},"publish_time":1428066857080,"_cnpm_publish_time":1428066857080,"_hasShrinkwrap":false},"1.0.0":{"name":"compare-func","version":"1.0.0","description":"Get a compare function for array to sort","homepage":"https://github.com/stevemao/compare-func","author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"https://github.com/stevemao/compare-func"},"license":"MIT","files":["index.js"],"keywords":["compare-func","arr","array","by","compare","dot","get","obj","object","prop","property","sort","sorting"],"dependencies":{"dot-prop":"^1.0.1","lodash.clonedeep":"^3.0.0","lodash.foreach":"^3.0.2"},"devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.3.8","jscs":"^1.11.3","jshint":"^2.6.3","mocha":"*"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec && rm -rf ./coverage","lint":"jshint *.js --exclude node_modules && jscs *.js","test":"npm run-script lint && mocha"},"gitHead":"6e34bb85640949824e22880b11873508c57003cd","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"_id":"compare-func@1.0.0","_shasum":"5169917b61b42cb8e7ab937e96d92963e61dcc35","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.0","_npmUser":{"name":"stevemao","email":"steve.mao@healthinteract.com.au"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"dist":{"shasum":"5169917b61b42cb8e7ab937e96d92963e61dcc35","size":1538,"noattachment":false,"key":"/compare-func/-/compare-func-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/compare-func/download/compare-func-1.0.0.tgz"},"directories":{},"publish_time":1428066658110,"_cnpm_publish_time":1428066658110,"_hasShrinkwrap":false},"0.0.0":{"name":"compare-func","version":"0.0.0","description":"Get a compare function for array to sort","homepage":"https://github.com/stevemao/compare-func","author":{"name":"Steve Mao","email":"maochenyan@gmail.com","url":"https://github.com/stevemao"},"repository":{"type":"git","url":"https://github.com/stevemao/compare-func"},"license":"MIT","files":["index.js"],"keywords":["compare-func","arr","array","by","compare","dot","get","obj","object","prop","property","sort","sorting"],"dependencies":{"dot-prop":"^1.0.1","lodash.clonedeep":"^3.0.0","lodash.foreach":"^3.0.2"},"devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.3.8","jscs":"^1.11.3","jshint":"^2.6.3","mocha":"*"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec && rm -rf ./coverage","lint":"jshint *.js --exclude node_modules && jscs *.js","test":"npm run-script lint && mocha"},"gitHead":"a80a4e891b97f0bb48adc42325f129f24926c5fb","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"_id":"compare-func@0.0.0","_shasum":"6f596fdf08ae57842104f8b5e78d15b6c3c96a50","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.0","_npmUser":{"name":"stevemao","email":"steve.mao@healthinteract.com.au"},"maintainers":[{"name":"stevemao","email":"maochenyan@gmail.com"}],"dist":{"shasum":"6f596fdf08ae57842104f8b5e78d15b6c3c96a50","size":1537,"noattachment":false,"key":"/compare-func/-/compare-func-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/compare-func/download/compare-func-0.0.0.tgz"},"directories":{},"publish_time":1428066181080,"_cnpm_publish_time":1428066181080,"_hasShrinkwrap":false}},"readme":"#  [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]\n\n> Get a compare function for array to sort\n\n\n## Install\n\n```sh\n$ npm install --save compare-func\n```\n\n\n## Usage\n\n```js\nvar compareFunc = require('compare-func');\n\n// sort by an object property\n[{x: 'b'}, {x: 'a'}, {x: 'c'}].sort(compareFunc('x'));\n//=> [{x: 'a'}, {x: 'b'}, {x: 'c'}]\n\n// sort by a nested object property\n[{x: {y: 'b'}}, {x: {y: 'a'}}].sort(compareFunc('x.y'));\n//=> [{x: {y: 'a'}}, {x: {y: 'b'}}]\n\n// sort by the `x` propery, then `y`\n[{x: 'c', y: 'c'}, {x: 'b', y: 'a'}, {x: 'b', y: 'b'}].sort(compareFunc(['x', 'y']));\n//=> [{x: 'b', y: 'a'}, {x: 'b', y: 'b'}, {x: 'c', y: 'c'}]\n\n// sort by the returned value\n[{x: 'b'}, {x: 'a'}, {x: 'c'}].sort(compareFunc(function(el) {\n  return el.x;\n}));\n//=> [{x: 'a'}, {x: 'b'}, {x: 'c'}]\n```\n\n\n## API\n\n### compareFunc([property])\n\nReturns a compare function for array to sort\n\n#### property\n\nType: `string`, `function` or `array` of either\n\nIf missing it sorts on itself.\n\nThe string can be a [dot path](https://github.com/sindresorhus/dot-prop) to a nested object property.\n\n\n## Related\n\n- [sort-on](https://github.com/sindresorhus/sort-on) - Sort an array on an object property\n\n\n## License\n\nMIT © [Steve Mao](https://github.com/stevemao)\n\n\n[npm-image]: https://badge.fury.io/js/compare-func.svg\n[npm-url]: https://npmjs.org/package/compare-func\n[travis-image]: https://travis-ci.org/stevemao/compare-func.svg?branch=master\n[travis-url]: https://travis-ci.org/stevemao/compare-func\n[daviddm-image]: https://david-dm.org/stevemao/compare-func.svg?theme=shields.io\n[daviddm-url]: https://david-dm.org/stevemao/compare-func\n[coveralls-image]: https://coveralls.io/repos/stevemao/compare-func/badge.svg\n[coveralls-url]: https://coveralls.io/r/stevemao/compare-func\n","_attachments":{},"homepage":"https://github.com/stevemao/compare-func","bugs":{"url":"https://github.com/stevemao/compare-func/issues"},"license":"MIT"}