{"_id":"function-extended","_rev":"3220884","name":"function-extended","description":"Additional function extensions with a chainable api","dist-tags":{"latest":"0.0.9"},"maintainers":[{"name":"damartin","email":"doug@dougamartin.com"}],"time":{"modified":"2024-03-21T07:22:10.000Z","created":"2013-01-16T21:43:33.467Z","0.0.9":"2014-04-01T18:02:00.338Z","0.0.8":"2013-11-21T06:41:37.490Z","0.0.7":"2013-11-20T23:54:01.908Z","0.0.6":"2013-06-06T21:33:49.174Z","0.0.5":"2013-06-05T05:37:12.719Z","0.0.4":"2013-04-16T16:03:23.551Z","0.0.3":"2013-01-22T07:14:23.955Z","0.0.2":"2013-01-20T19:20:34.531Z","0.0.1":"2013-01-16T21:43:33.467Z"},"users":{},"author":{"name":"Doug Martin"},"repository":{"type":"git","url":"git:git@github.com:doug-martin/function-extended.git"},"versions":{"0.0.9":{"name":"function-extended","version":"0.0.9","description":"Additional function extensions with a chainable api","main":"index.js","scripts":{"test":"it -r dot"},"repository":{"type":"git","url":"git:git@github.com:doug-martin/function-extended.git"},"keywords":["String","extender","utilities"],"testling":{"files":"test/browserling.js","browsers":["ie/6..latest","chrome/20..latest","firefox/14..latest","safari/latest","iphone/6","ipad/6"]},"author":{"name":"Doug Martin"},"license":"MIT","dependencies":{"extended":"~0.0.3","is-extended":"~0.0.3","arguments-extended":"~0.0.3"},"devDependencies":{"grunt":"~0.4.1","it":"~0.2.0","grunt-it":"~0.3.0","grunt-contrib-uglify":"~0.2.0","grunt-contrib-jshint":"~0.4.3"},"bugs":{"url":"https://github.com/doug-martin/function-extended/issues"},"homepage":"https://github.com/doug-martin/function-extended","_id":"function-extended@0.0.9","dist":{"shasum":"f28b3f0762354753d4ad6edb80ae8edbee334361","size":10863,"noattachment":false,"key":"/function-extended/-/function-extended-0.0.9.tgz","tarball":"http://registry.cnpm.dingdandao.com/function-extended/download/function-extended-0.0.9.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"damartin","email":"doug@dougamartin.com"},"maintainers":[{"name":"damartin","email":"doug@dougamartin.com"}],"directories":{},"publish_time":1396375320338,"_hasShrinkwrap":false,"_cnpm_publish_time":1396375320338,"_cnpmcore_publish_time":"2021-12-16T13:34:02.393Z"},"0.0.8":{"name":"function-extended","version":"0.0.8","description":"Additional function extensions with a chainable api","main":"index.js","scripts":{"test":"it -r dot"},"repository":{"type":"git","url":"git:git@github.com:doug-martin/function-extended.git"},"keywords":["String","extender","utilities"],"testling":{"files":"test/browserling.js","browsers":["ie/6..latest","chrome/20..latest","firefox/14..latest","safari/latest","iphone/6","ipad/6"]},"author":{"name":"Doug Martin"},"license":"MIT","dependencies":{"extended":"~0.0.3","is-extended":"~0.0.3","grunt":"~0.4.1","arguments-extended":"~0.0.3"},"devDependencies":{"it":"~0.2.0","grunt-it":"~0.3.0","grunt-contrib-uglify":"~0.2.0","grunt-contrib-jshint":"~0.4.3"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/doug-martin/function-extended/issues"},"_id":"function-extended@0.0.8","dist":{"shasum":"0cc26ed78bf1000389f5df54d53b3d12388ed199","size":10856,"noattachment":false,"key":"/function-extended/-/function-extended-0.0.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/function-extended/download/function-extended-0.0.8.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"damartin","email":"doug@dougamartin.com"},"maintainers":[{"name":"damartin","email":"doug@dougamartin.com"}],"directories":{},"publish_time":1385016097490,"_hasShrinkwrap":false,"_cnpm_publish_time":1385016097490,"_cnpmcore_publish_time":"2021-12-16T13:34:02.657Z"},"0.0.7":{"name":"function-extended","version":"0.0.7","description":"Additional function extensions with a chainable api","main":"index.js","scripts":{"test":"it -r dot"},"repository":{"type":"git","url":"git:git@github.com:doug-martin/function-extended.git"},"keywords":["String","extender","utilities"],"testling":{"files":"test/browserling.js","browsers":["ie/6..latest","chrome/20..latest","firefox/14..latest","safari/latest","iphone/6","ipad/6"]},"author":{"name":"Doug Martin"},"license":"MIT","dependencies":{"extended":"~0.0.3","is-extended":"~0.0.3","grunt":"~0.4.1","arguments-extended":"~0.0.3"},"devDependencies":{"it":"~0.2.0","grunt-it":"~0.3.0","grunt-contrib-uglify":"~0.2.0","grunt-contrib-jshint":"~0.4.3"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/doug-martin/function-extended/issues"},"_id":"function-extended@0.0.7","dist":{"shasum":"72db635ccc76326639a91a01875abc0d53c2261c","size":10809,"noattachment":false,"key":"/function-extended/-/function-extended-0.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/function-extended/download/function-extended-0.0.7.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"damartin","email":"doug@dougamartin.com"},"maintainers":[{"name":"damartin","email":"doug@dougamartin.com"}],"directories":{},"publish_time":1384991641908,"_hasShrinkwrap":false,"_cnpm_publish_time":1384991641908,"_cnpmcore_publish_time":"2021-12-16T13:34:03.263Z"},"0.0.6":{"name":"function-extended","version":"0.0.6","description":"Additional function extensions with a chainable api","main":"index.js","scripts":{"test":"it -r dot"},"repository":{"type":"git","url":"git:git@github.com:doug-martin/function-extended.git"},"keywords":["String","extender","utilities"],"testling":{"files":"test/browserling.js","browsers":["ie/6..latest","chrome/20..latest","firefox/14..latest","safari/latest","iphone/6","ipad/6"]},"author":{"name":"Doug Martin"},"license":"MIT","dependencies":{"extended":"~0.0.3","is-extended":"~0.0.3","grunt":"~0.4.1","arguments-extended":"~0.0.3"},"devDependencies":{"it":"~0.2.0","grunt-it":"~0.3.0","grunt-contrib-uglify":"~0.2.0","grunt-contrib-jshint":"~0.4.3"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/doug-martin/function-extended/issues"},"_id":"function-extended@0.0.6","dist":{"shasum":"1819f19a46f2c0b3ad50ebf70e94e40291c15211","size":7181,"noattachment":false,"key":"/function-extended/-/function-extended-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/function-extended/download/function-extended-0.0.6.tgz"},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"damartin","email":"doug@dougamartin.com"},"maintainers":[{"name":"damartin","email":"doug@dougamartin.com"}],"directories":{},"publish_time":1370554429174,"_hasShrinkwrap":false,"_cnpm_publish_time":1370554429174,"_cnpmcore_publish_time":"2021-12-16T13:34:03.522Z"},"0.0.5":{"name":"function-extended","version":"0.0.5","description":"Additional function extensions with a chainable api","main":"index.js","scripts":{"test":"it -r dot"},"repository":{"type":"git","url":"git:git@github.com:doug-martin/function-extended.git"},"keywords":["String","extender","utilities"],"testling":{"files":"test/browserling.js","browsers":["ie/6..latest","chrome/20..latest","firefox/14..latest","safari/latest","iphone/6","ipad/6"]},"author":{"name":"Doug Martin"},"license":"MIT","dependencies":{"extended":"~0.0.3","is-extended":"~0.0.3","grunt":"~0.4.1"},"devDependencies":{"it":"~0.2.0","grunt-it":"~0.3.0","grunt-contrib-uglify":"~0.2.0","grunt-contrib-jshint":"~0.4.3"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/doug-martin/function-extended/issues"},"_id":"function-extended@0.0.5","dist":{"shasum":"dac8713976a1abea5c97c4f818bd18402f2e736a","size":7217,"noattachment":false,"key":"/function-extended/-/function-extended-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/function-extended/download/function-extended-0.0.5.tgz"},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"damartin","email":"doug@dougamartin.com"},"maintainers":[{"name":"damartin","email":"doug@dougamartin.com"}],"directories":{},"publish_time":1370410632719,"_hasShrinkwrap":false,"_cnpm_publish_time":1370410632719,"_cnpmcore_publish_time":"2021-12-16T13:34:03.757Z"},"0.0.4":{"name":"function-extended","version":"0.0.4","description":"Additional function extensions with a chainable api","main":"index.js","scripts":{"test":"it -r dot"},"repository":{"type":"git","url":"git:git@github.com:doug-martin/function-extended.git"},"keywords":["String","extender","utilities"],"testling":{"files":"test/browserling.js","browsers":["ie/6..latest","chrome/20..latest","firefox/14..latest","safari/latest","iphone/6","ipad/6"]},"author":{"name":"Doug Martin"},"license":"MIT","dependencies":{"extended":"~0.0.3","is-extended":"~0.0.3","grunt":"~0.4.1"},"devDependencies":{"it":"~0.2.0","grunt-it":"~0.3.0","grunt-contrib-uglify":"~0.2.0","grunt-contrib-jshint":"~0.4.3"},"readmeFilename":"README.md","_id":"function-extended@0.0.4","dist":{"shasum":"717b518e458347c1ad3aa9e05b15d4a999ca4922","size":6934,"noattachment":false,"key":"/function-extended/-/function-extended-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/function-extended/download/function-extended-0.0.4.tgz"},"_from":".","_npmVersion":"1.2.17","_npmUser":{"name":"damartin","email":"doug@dougamartin.com"},"maintainers":[{"name":"damartin","email":"doug@dougamartin.com"}],"directories":{},"publish_time":1366128203551,"_hasShrinkwrap":false,"_cnpm_publish_time":1366128203551,"_cnpmcore_publish_time":"2021-12-16T13:34:03.968Z"},"0.0.3":{"name":"function-extended","version":"0.0.3","description":"Additional function extensions with a chainable api","main":"index.js","scripts":{"test":"it -r dot"},"repository":{"type":"git","url":"git:git@github.com:doug-martin/string-extended.git"},"keywords":["String","extender","utilities"],"testling":{"files":"test/browserling.js","browsers":{"ie":[6,7,8,9],"chrome":[4,23,"canary"],"firefox":[3,3.5,3.6,4,17,"nightly"],"opera":[10,10.5,11,11.5,11.6,12,"next"],"safari":["5.0.1",5.1]}},"author":{"name":"Doug Martin"},"license":"MIT","dependencies":{"extended":"~0.0.3","is-extended":"~0.0.3"},"devDependencies":{"it":"~0.2.0","grunt-it":"~0.2.0"},"readmeFilename":"README.md","_id":"function-extended@0.0.3","dist":{"shasum":"4a7642738400d38c0e89f1f5b34f26c7d21cf5a8","size":6999,"noattachment":false,"key":"/function-extended/-/function-extended-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/function-extended/download/function-extended-0.0.3.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"damartin","email":"doug@dougamartin.com"},"maintainers":[{"name":"damartin","email":"doug@dougamartin.com"}],"directories":{},"publish_time":1358838863955,"_hasShrinkwrap":false,"_cnpm_publish_time":1358838863955,"_cnpmcore_publish_time":"2021-12-16T13:34:04.156Z"},"0.0.2":{"name":"function-extended","version":"0.0.2","description":"Additional function extensions with a chainable api","main":"index.js","scripts":{"test":"it -r dot"},"repository":{"type":"git","url":"git:git@github.com:doug-martin/string-extended.git"},"keywords":["String","extender","utilities"],"author":{"name":"Doug Martin"},"license":"MIT","dependencies":{"extended":"0.0.2","is-extended":"0.0.2"},"devDependencies":{"it":"~0.1.0","grunt-it":"~0.2.0"},"readmeFilename":"README.md","_id":"function-extended@0.0.2","dist":{"shasum":"644210d3599a05620e10994b01f2173fcb52a686","size":6779,"noattachment":false,"key":"/function-extended/-/function-extended-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/function-extended/download/function-extended-0.0.2.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"damartin","email":"doug@dougamartin.com"},"maintainers":[{"name":"damartin","email":"doug@dougamartin.com"}],"directories":{},"publish_time":1358709634531,"_hasShrinkwrap":false,"_cnpm_publish_time":1358709634531,"_cnpmcore_publish_time":"2021-12-16T13:34:04.343Z"},"0.0.1":{"name":"function-extended","version":"0.0.1","description":"Additional function extensions with a chainable api","main":"index.js","scripts":{"test":"it -r dot"},"repository":{"type":"git","url":"git:git@github.com:doug-martin/string-extended.git"},"keywords":["String","extender","utilities"],"author":{"name":"Doug Martin"},"license":"MIT","dependencies":{"extender":"0.0.4","is-extended":"0.0.1"},"devDependencies":{"it":"~0.1.0","grunt-it":"~0.2.0"},"readmeFilename":"README.md","_id":"function-extended@0.0.1","dist":{"shasum":"8a8a75511931f7e4343c28ee407e99b131a2b49f","size":6799,"noattachment":false,"key":"/function-extended/-/function-extended-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/function-extended/download/function-extended-0.0.1.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"damartin","email":"doug@dougamartin.com"},"maintainers":[{"name":"damartin","email":"doug@dougamartin.com"}],"directories":{},"publish_time":1358372613467,"_hasShrinkwrap":false,"_cnpm_publish_time":1358372613467,"_cnpmcore_publish_time":"2021-12-16T13:34:04.587Z"}},"readme":"[![Build Status](https://travis-ci.org/doug-martin/function-extended.png?branch=master)](undefined)\n\n[![browser support](https://ci.testling.com/doug-martin/function-extended.png)](https://ci.testling.com/doug-martin/function-extended)\n\n# function-extended\n\n`function-extended` is a Javascript library that can be used standalone or incorporated into [`extended`](https://github.com/doug-martin/extended)\n\n```javascript\nvar fn = require(\"function-extended\");\n```\n\nOr\n\n```javascript\nvar myextended = require(\"extended\")\n\t.register(require(\"function-extended\"));\n```\n\n## Installation\n\n```\nnpm install function-extended\n```\n\nOr [download the source](https://raw.github.com/doug-martin/function-extended/master/index.js) ([minified](https://raw.github.com/doug-martin/function-extended/master/function-extended.min.js))\n\n## Usage\n\n**`bind`**\n\nBinds a function to the specified scope, while currying any extra arguments.\n\n**`bindAll`**\n\nBinds all functions or a list of named functions to the specified scope.\n\n```javascript\nvar scope = {\n    a: \"a\",\n    b: \"b\",\n    c: \"c\",\n    aFunc: function () {\n        return this.a;\n    },\n    bFunc: function () {\n        return this.b;\n    },\n    cFunc: function () {\n        return this.c;\n    }\n};\n\nfn.bindAll(scope);\n\nscope.aFunc.call({}); //\"a\"\nscope.bFunc.call({}); //\"a\"\nscope.cFunc.call({}); //\"c\"\n\n//or\n\nfn.bindAll(scope, [\"aFunc\"]);\n\nscope.aFunc.call({}); //\"a\"\nscope.bFunc.call({}); //undefined\nscope.cFunc.call({}); //undefined\n\n```\n\n\n**`bindIgnore`**\n\nBinds a function to the specified scope while ignoring any extra arguments passed in.\n\n```javascript\nvar func = function () {\n    return [arguments.length, this.test];\n};\nvar scope = {test: true};\n\nvar fn1 = fn.bindIgnore(obj, func, \"hello\"),\n    fn2 = fn(func).bindIgnore(obj, \"hello\").f(),\n    fn3 = fn(obj).bindIgnore(func, \"hello\");\n\n\nfn1(\"world\"); //[1, true]\nfn2(\"world\"); //[1,true]\nfn3.f()(\"world\"); //[1, true];\n```\n\n**`partial`**\n\nCreates a function that does not change the eventual scope, but allows the you specify arguments that should be passed in.\n\n```javascript\nvar func = function (str) {\n    return str + \" \" + this.world;\n};\n\nvar a = fn.partial(func, \"hello\");\nvar b =fn(func).partial(\"hello\").f();\n\na.call({world: \"world\"}); //hello world\nb.call({world: \"world\"}); //hello world\n\n//With a string\n\nvar c = fn.partial(\"test\"),\n    c2 = fn(\"test2\").partial().f(),\n\nvar scope = {\n    test : function(){\n        return \"hello\";\n    },\n    test2 : function(){\n        return \"world\";\n    }\n};\nc.call(scope); //hello\nc2.call(scope); //world\n```\n\n**`applyFirst`**\n\nBinds the function to the first arguments passed in.\n\n```javascript\n\nvar func = function () {\n    return this.test;\n};\n\nvar newFn = fn.applyFirst(func);\nnewFn({test: true}); //true\n\nnewFn = fn(func).applyFirst().f();\nnewFn({test: true});\n\nvar push = fn.applyFirst(\"push\"), pop = fn(\"pop\").applyFirst().fn();\n\nvar arr = [];\npush(arr, 1);\n//arr === [1];\n\npop(arr);\n//arr === [];\n\n```\n\n**`curry`**\n\nCreate a curried function.\n\n```javascript\nvar curried = fn.curry(4, function(a,b,c,d){\n    return [a,b,c,d].join(\",\");\n});\n\ncurried(\"a\");\ncurried(\"b\");\ncurried(\"c\");\ncurried(\"d\"); //\"a,b,c,d\"\n\n//OR\n\ncurried(\"a\")(\"b\")(\"c\")(\"d\"); //\"a,b,c,d\"\n```\n\n\n","_attachments":{},"homepage":"https://github.com/doug-martin/function-extended","bugs":{"url":"https://github.com/doug-martin/function-extended/issues"},"license":"MIT"}