{"_id":"auto-curry","_rev":"161791","name":"auto-curry","description":"Supercharge your functions by giving them the ability to auto-curry","dist-tags":{"latest":"0.2.1"},"maintainers":[{"name":"zeusdeux","email":"zeusdeux@gmail.com"}],"time":{"modified":"2021-06-03T11:41:06.000Z","created":"2014-09-02T06:36:52.797Z","0.2.1":"2016-10-17T23:08:32.216Z","0.2.0":"2014-10-04T10:06:16.762Z","0.1.1":"2014-09-08T07:43:24.009Z","0.1.0":"2014-09-02T06:36:52.797Z"},"users":{"fgribreau":true},"author":{"name":"Mudit Ameta"},"repository":{"type":"git","url":"git+https://github.com/zeusdeux/auto-curry.git"},"versions":{"0.2.1":{"name":"auto-curry","version":"0.2.1","description":"Supercharge your functions by giving them the ability to auto-curry","main":"index.js","keywords":["curry","auto","functional","function","currying"],"author":{"name":"Mudit Ameta"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/zeusdeux/auto-curry.git"},"bugs":{"url":"https://github.com/zeusdeux/auto-curry/issues"},"homepage":"https://github.com/zeusdeux/auto-curry","devDependencies":{"browserify":"^6.0.2","jshint":"^2.5.6","mocha":"^1.21.4","uglify-js":"^2.4.15"},"gitHead":"f71485133930da61525f509243010b3159c1a6f0","_id":"auto-curry@0.2.1","scripts":{},"_shasum":"d50a2c4273b465e5a2d311bbe946355a68be6e53","_from":".","_npmVersion":"3.10.6","_nodeVersion":"6.3.0","_npmUser":{"name":"zeusdeux","email":"zeusdeux@gmail.com"},"dist":{"shasum":"d50a2c4273b465e5a2d311bbe946355a68be6e53","size":4599,"noattachment":false,"key":"/auto-curry/-/auto-curry-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/auto-curry/download/auto-curry-0.2.1.tgz"},"maintainers":[{"name":"zeusdeux","email":"zeusdeux@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/auto-curry-0.2.1.tgz_1476745710475_0.40052373986691236"},"directories":{},"publish_time":1476745712216,"_cnpm_publish_time":1476745712216,"_hasShrinkwrap":false},"0.2.0":{"name":"auto-curry","version":"0.2.0","description":"Supercharge your functions by giving them the ability to auto-curry","main":"index.js","keywords":["curry","auto","functional","function","currying"],"author":{"name":"Mudit Ameta"},"license":"MIT","repository":{"type":"git","url":"https://github.com/zeusdeux/auto-curry"},"bugs":{"url":"https://github.com/zeusdeux/auto-curry/issues"},"homepage":"https://github.com/zeusdeux/auto-curry","devDependencies":{"browserify":"^6.0.2","jshint":"^2.5.6","mocha":"^1.21.4","uglify-js":"^2.4.15"},"gitHead":"d3240845d7d32e095292217eed00d92fd19dc989","_id":"auto-curry@0.2.0","scripts":{},"_shasum":"e027da967793088103da18a1bb9d1481c721a9db","_from":".","_npmVersion":"1.4.24","_npmUser":{"name":"zeusdeux","email":"zeusdeux@gmail.com"},"maintainers":[{"name":"zeusdeux","email":"zeusdeux@gmail.com"}],"dist":{"shasum":"e027da967793088103da18a1bb9d1481c721a9db","size":4164,"noattachment":false,"key":"/auto-curry/-/auto-curry-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/auto-curry/download/auto-curry-0.2.0.tgz"},"directories":{},"publish_time":1412417176762,"_cnpm_publish_time":1412417176762,"_hasShrinkwrap":false},"0.1.1":{"name":"auto-curry","version":"0.1.1","description":"Supercharge your functions by giving them the ability to auto-curry","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["curry","auto","functional","function","currying"],"author":{"name":"Mudit Ameta"},"license":"MIT","repository":{"type":"git","url":"https://github.com/zeusdeux/auto-curry"},"bugs":{"url":"https://github.com/zeusdeux/auto-curry/issues"},"homepage":"https://github.com/zeusdeux/auto-curry","gitHead":"085699074fff0de0305aef16c52edca8960a1f0e","_id":"auto-curry@0.1.1","_shasum":"70196e162ef8b7e52a2c57084e5f1cb8f3da91d1","_from":".","_npmVersion":"1.4.24","_npmUser":{"name":"zeusdeux","email":"zeusdeux@gmail.com"},"maintainers":[{"name":"zeusdeux","email":"zeusdeux@gmail.com"}],"dist":{"shasum":"70196e162ef8b7e52a2c57084e5f1cb8f3da91d1","size":1750,"noattachment":false,"key":"/auto-curry/-/auto-curry-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/auto-curry/download/auto-curry-0.1.1.tgz"},"directories":{},"publish_time":1410162204009,"_cnpm_publish_time":1410162204009,"_hasShrinkwrap":false},"0.1.0":{"name":"auto-curry","version":"0.1.0","description":"Supercharge your functions by giving them the ability to auto-curry","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["curry","auto","functional","function","currying"],"author":{"name":"Mudit Ameta"},"license":"MIT","repository":{"type":"git","url":"https://github.com/zeusdeux/auto-curry"},"bugs":{"url":"https://github.com/zeusdeux/auto-curry/issues"},"homepage":"https://github.com/zeusdeux/auto-curry","gitHead":"2219bc57ece4ec58153023a40f888160c72de8e9","_id":"auto-curry@0.1.0","_shasum":"9bec32a5c6be9ef3ac579cf603a2f1c72c66b2f4","_from":".","_npmVersion":"1.4.24","_npmUser":{"name":"zeusdeux","email":"zeusdeux@gmail.com"},"maintainers":[{"name":"zeusdeux","email":"zeusdeux@gmail.com"}],"dist":{"shasum":"9bec32a5c6be9ef3ac579cf603a2f1c72c66b2f4","size":1852,"noattachment":false,"key":"/auto-curry/-/auto-curry-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/auto-curry/download/auto-curry-0.1.0.tgz"},"directories":{},"publish_time":1409639812797,"_cnpm_publish_time":1409639812797,"_hasShrinkwrap":false}},"readme":"auto-curry\n==========\n\nSupercharge your functions by giving them the ability to auto-curry.\n\n> Note:\n> This library actually uses partial application internally and not currying. So, yes, the name is a misnomer.\n> It is the result of my incorrect understanding of the concepts when I wrote the library.\n> It is still perfectly usable and is used in production.\n\n# Installation\n\n```javascript\nnpm install auto-curry --save\n```\n\n# Usage\n\nIn `node`, you can just `require('auto-curry')`.\n\nIn the browser, you can use `build/auto-curry.min.js`\n\n- with `require.js`, `browserify` etc\n- directly by using `window.autoCurry`\n\n## Node\n\n```javascript\nvar cu = require('auto-curry');\nvar add = cu(function (a, b) {\n    return a + b;\n});\nvar messWithThis = cu(function(v){\n  this.a.push(v);\n  return ++v;\n});\nvar map = cu(function map(fn, list) {\n  var self = arguments[2] ? arguments[2] : this;\n  try {\n    return list.map(fn, self);\n  }\n  catch (e) {\n    return [].map.call(list, fn, self);\n  }\n});\nvar x = {a: []};\n\nconsole.log(map(add(1), [1, 2, 3])); //[2, 3, 4]\nconsole.log(map(messWithThis, [1,2,3], x)); //[2, 3, 4]\nconsole.log(x.a); //[1, 2, 3]\n```\n\n## Browser\n\n```javascript\nvar cu = window.autoCurry; //using it off the global\nvar add = cu(function (a, b) {\n    return a + b;\n});\nvar messWithThis = cu(function(v){\n  this.a.push(v);\n  return ++v;\n});\nvar map = cu(function map(fn, list) {\n  console.log(arguments[2]);\n  var self = arguments[2] ? arguments[2] : this;\n  try {\n    return list.map(fn, self);\n  }\n  catch (e) {\n    return [].map.call(list, fn, self);\n  }\n});\nvar x = {a: []};\n\nconsole.log(map(add(1), [1, 2, 3])); //[2, 3, 4]\nconsole.log(map(messWithThis, [1,2,3], x)); //[2, 3, 4]\nconsole.log(x.a); //[1, 2, 3]\n```\n\n# License\n\n[MIT](https://github.com/zeusdeux/auto-curry/blob/master/LICENSE)\n\n# Changelog\n\n#### `0.2.1`\n- Now, if the function passed to `auto-curry` has an arity of one, the function itself is returned. Earlier this was only for zero arity functions.\n","_attachments":{},"homepage":"https://github.com/zeusdeux/auto-curry","bugs":{"url":"https://github.com/zeusdeux/auto-curry/issues"},"license":"MIT"}