{"_id":"to-function","_rev":"78816","name":"to-function","description":"Convert property access strings into functions","dist-tags":{"latest":"2.0.6"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"time":{"modified":"2021-06-03T10:25:16.000Z","created":"2012-09-20T17:11:44.375Z","2.0.6":"2015-01-30T04:46:53.067Z","2.0.5":"2014-05-28T00:30:08.078Z","2.0.4":"2014-05-20T17:10:17.246Z","2.0.3":"2014-04-04T01:57:26.039Z","2.0.1":"2014-03-26T23:39:47.006Z","2.0.0":"2014-03-26T23:19:33.157Z","1.2.1":"2014-02-12T17:00:47.022Z","1.2.0":"2012-12-16T19:28:56.439Z","1.1.1":"2012-11-21T03:25:28.483Z","1.1.0":"2012-11-21T03:19:18.126Z","1.0.0":"2012-11-09T02:34:46.513Z","0.0.1":"2012-09-20T17:11:44.375Z"},"users":{"lvivier":true},"repository":{"type":"git","url":"https://github.com/component/to-function.git"},"versions":{"2.0.6":{"name":"to-function","repo":"component/to-function","description":"Convert property access strings into functions","version":"2.0.6","keywords":["utility"],"dependencies":{"component-props":"*"},"scripts":{"test":"make test"},"devDependencies":{"better-assert":"*","mocha":"*","should":"*"},"browser":{"props":"component-props"},"component":{"scripts":{"to-function/index.js":"index.js"}},"repository":{"type":"git","url":"https://github.com/component/to-function.git"},"gitHead":"8ea555132a66c0d951e5917580f91fa0b1b4441a","bugs":{"url":"https://github.com/component/to-function/issues"},"homepage":"https://github.com/component/to-function","_id":"to-function@2.0.6","_shasum":"7d56cd9c3b92fa8dbd7b22e83d51924de740ebc5","_from":".","_npmVersion":"2.1.2","_nodeVersion":"0.10.32","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"dist":{"shasum":"7d56cd9c3b92fa8dbd7b22e83d51924de740ebc5","size":3514,"noattachment":false,"key":"/to-function/-/to-function-2.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-function/download/to-function-2.0.6.tgz"},"directories":{},"publish_time":1422593213067,"_cnpm_publish_time":1422593213067,"_hasShrinkwrap":false},"2.0.5":{"name":"to-function","repo":"component/to-function","description":"Convert property access strings into functions","version":"2.0.5","keywords":["utility"],"dependencies":{"component-props":"*","remove-try-require":"0.0.0"},"scripts":{"test":"make test"},"devDependencies":{"better-assert":"*","mocha":"*","should":"*"},"browserify":{"transform":["remove-try-require"]},"component":{"scripts":{"to-function/index.js":"index.js"}},"repository":{"type":"git","url":"https://github.com/component/to-function.git"},"bugs":{"url":"https://github.com/component/to-function/issues"},"homepage":"https://github.com/component/to-function","_id":"to-function@2.0.5","_shasum":"949d18c27d9b5b9ea9f3282170be1201d0b35c68","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"dist":{"shasum":"949d18c27d9b5b9ea9f3282170be1201d0b35c68","size":3531,"noattachment":false,"key":"/to-function/-/to-function-2.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-function/download/to-function-2.0.5.tgz"},"directories":{},"publish_time":1401237008078,"_cnpm_publish_time":1401237008078,"_hasShrinkwrap":false},"2.0.4":{"name":"to-function","repo":"component/to-function","description":"Convert property access strings into functions","version":"2.0.4","keywords":["utility"],"dependencies":{"component-props":"*"},"scripts":{"test":"make test"},"devDependencies":{"better-assert":"*","mocha":"*","remove-try-require":"0.0.0","should":"*"},"browserify":{"transform":["remove-try-require"]},"component":{"scripts":{"to-function/index.js":"index.js"}},"repository":{"type":"git","url":"https://github.com/component/to-function.git"},"bugs":{"url":"https://github.com/component/to-function/issues"},"homepage":"https://github.com/component/to-function","_id":"to-function@2.0.4","_shasum":"be6b5549b25ea5b0b4262f536efc4d415f4ec00f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"dist":{"shasum":"be6b5549b25ea5b0b4262f536efc4d415f4ec00f","size":3506,"noattachment":false,"key":"/to-function/-/to-function-2.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-function/download/to-function-2.0.4.tgz"},"directories":{},"publish_time":1400605817246,"_cnpm_publish_time":1400605817246,"_hasShrinkwrap":false},"2.0.3":{"name":"to-function","repo":"component/to-function","description":"Convert property access strings into functions","version":"2.0.3","keywords":["utility"],"dependencies":{"component-props":"*"},"scripts":{"test":"make test"},"devDependencies":{"better-assert":"*","mocha":"*","remove-try-require":"0.0.0","should":"*"},"browserify":{"transform":["remove-try-require"]},"component":{"scripts":{"to-function/index.js":"index.js"}},"repository":{"type":"git","url":"https://github.com/component/to-function.git"},"bugs":{"url":"https://github.com/component/to-function/issues"},"homepage":"https://github.com/component/to-function","_id":"to-function@2.0.3","dist":{"shasum":"bd44c8134a9ab687365cddf1e48606925fb09985","size":3147,"noattachment":false,"key":"/to-function/-/to-function-2.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-function/download/to-function-2.0.3.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"timoxley","email":"secoif@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"directories":{},"publish_time":1396576646039,"_cnpm_publish_time":1396576646039,"_hasShrinkwrap":false},"2.0.1":{"name":"to-function","repo":"component/to-function","description":"Convert property access strings into functions","version":"2.0.1","keywords":["utility"],"dependencies":{"component-props":"*"},"devDependencies":{"mocha":"*","should":"*","better-assert":"*"},"component":{"scripts":{"to-function/index.js":"index.js"}},"repository":{"type":"git","url":"https://github.com/component/to-function.git"},"bugs":{"url":"https://github.com/component/to-function/issues"},"homepage":"https://github.com/component/to-function","_id":"to-function@2.0.1","dist":{"shasum":"23d326ccaebb9a0a4d80c1a952b39182e14f3e4f","size":3009,"noattachment":false,"key":"/to-function/-/to-function-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-function/download/to-function-2.0.1.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"mattmueller","email":"mattmuelle@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"directories":{},"publish_time":1395877187006,"_cnpm_publish_time":1395877187006,"_hasShrinkwrap":false},"2.0.0":{"name":"to-function","repo":"component/to-function","description":"Convert property access strings into functions","version":"2.0.0","keywords":["utility"],"dependencies":{"props-component":"*"},"devDependencies":{"mocha":"*","should":"*","better-assert":"*"},"component":{"scripts":{"to-function/index.js":"index.js"}},"repository":{"type":"git","url":"https://github.com/component/to-function.git"},"bugs":{"url":"https://github.com/component/to-function/issues"},"homepage":"https://github.com/component/to-function","_id":"to-function@2.0.0","dist":{"shasum":"c059ff7483ec60c9fea14219d3833c70c0c6e66a","size":2995,"noattachment":false,"key":"/to-function/-/to-function-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-function/download/to-function-2.0.0.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"mattmueller","email":"mattmuelle@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"directories":{},"publish_time":1395875973157,"_cnpm_publish_time":1395875973157,"_hasShrinkwrap":false},"1.2.1":{"name":"to-function","repo":"component/to-function","description":"Convert property access strings into functions","version":"1.2.1","keywords":["utility"],"dependencies":{"props-component":"*"},"devDependencies":{"mocha":"*","should":"*","better-assert":"*"},"component":{"scripts":{"to-function/index.js":"index.js"}},"repository":{"type":"git","url":"https://github.com/component/to-function.git"},"bugs":{"url":"https://github.com/component/to-function/issues"},"homepage":"https://github.com/component/to-function","_id":"to-function@1.2.1","dist":{"shasum":"7d2f341b11ffd534d42ad3e107f2bf93f88a2a6f","size":2955,"noattachment":false,"key":"/to-function/-/to-function-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-function/download/to-function-1.2.1.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"mattmueller","email":"mattmuelle@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"directories":{},"publish_time":1392224447022,"_cnpm_publish_time":1392224447022,"_hasShrinkwrap":false},"1.2.0":{"name":"to-function","repo":"component/to-function","description":"Convert property access strings into functions","version":"1.2.0","keywords":["utility"],"dependencies":{"better-assert":"~0.1.0"},"devDependencies":{"mocha":"*","should":"*"},"component":{"scripts":{"to-function/index.js":"index.js"}},"readmeFilename":"Readme.md","_id":"to-function@1.2.0","dist":{"shasum":"28e3aca4bace0f5fe2a3727b476037686e4efe68","size":2740,"noattachment":false,"key":"/to-function/-/to-function-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-function/download/to-function-1.2.0.tgz"},"_npmVersion":"1.1.66","_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"directories":{},"publish_time":1355686136439,"_cnpm_publish_time":1355686136439,"_hasShrinkwrap":false},"1.1.1":{"name":"to-function","repo":"component/to-function","description":"Convert property access strings into functions","version":"1.1.1","keywords":["utility"],"dependencies":{},"devDependencies":{"mocha":"*","should":"*"},"component":{"scripts":{"to-function/index.js":"index.js"}},"readmeFilename":"Readme.md","_id":"to-function@1.1.1","dist":{"shasum":"0aa69c33ea6efa4978341fd599c50c2eb1f9cbb8","size":1704,"noattachment":false,"key":"/to-function/-/to-function-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-function/download/to-function-1.1.1.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"directories":{},"publish_time":1353468328483,"_cnpm_publish_time":1353468328483,"_hasShrinkwrap":false},"1.1.0":{"name":"to-function","repo":"component/to-function","description":"Convert property access strings into functions","version":"1.1.0","keywords":["utility"],"dependencies":{},"devDependencies":{"mocha":"*","should":"*"},"component":{"scripts":{"to-function/index.js":"index.js"}},"readmeFilename":"Readme.md","_id":"to-function@1.1.0","dist":{"shasum":"4dae98aee41c3d44f52460cfcead3536b5b4e6e2","size":1601,"noattachment":false,"key":"/to-function/-/to-function-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-function/download/to-function-1.1.0.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"directories":{},"publish_time":1353467958126,"_cnpm_publish_time":1353467958126,"_hasShrinkwrap":false},"1.0.0":{"name":"to-function","repo":"component/to-function","description":"Convert property access strings into functions","version":"1.0.0","keywords":["utility"],"dependencies":{},"devDependencies":{"mocha":"*","should":"*"},"component":{"scripts":{"to-function/index.js":"index.js"}},"readmeFilename":"Readme.md","_id":"to-function@1.0.0","dist":{"shasum":"da857783f9392bd75f0e31efcb926ce9ea437e13","size":1440,"noattachment":false,"key":"/to-function/-/to-function-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-function/download/to-function-1.0.0.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"directories":{},"publish_time":1352428486513,"_cnpm_publish_time":1352428486513,"_hasShrinkwrap":false},"0.0.1":{"name":"to-function","repo":"component/to-function","description":"Convert property access strings into functions","version":"0.0.1","keywords":["utility"],"dependencies":{},"development":{},"component":{"scripts":{"to-function/index.js":"index.js"}},"_id":"to-function@0.0.1","dist":{"shasum":"ba7bd314c7f1324750b5127e8d7ef9c9d0c2ec11","size":977,"noattachment":false,"key":"/to-function/-/to-function-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/to-function/download/to-function-0.0.1.tgz"},"_npmVersion":"1.1.61","_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"thehydroimpulse","email":"dnfagnan@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"}],"directories":{},"publish_time":1348161104375,"_cnpm_publish_time":1348161104375,"_hasShrinkwrap":false}},"readme":"# to-function\n\n  Convert property access strings into functions\n\n## Installation\n\n    $ component install component/to-function\n\n## Examples\n\n```js\nvar toFunction = require('to-function');\nvar fn = toFunction('name.first');\nvar user = { name: { first: 'Tobi' }};\nfn(user);\n// => \"Tobi\"\n```\n\n### Dot access\n\n```js\n\nvar _ = require('..');\n\nvar users = [\n  { name: { first: 'Tobi' }},\n  { name: { first: 'Loki' }},\n  { name: { first: 'Jane' }},\n  { name: { first: 'Manny' }}\n];\n\nvar short = users.map(_('name.first'));\nconsole.log(short);\n// => [ 'Tobi', 'Loki', 'Jane', 'Manny' ]\n```\n\n### Equality\n\n```js\nvar _ = require('..');\n\nvar tobi = { name: { first: 'Tobi' }, age: 2 };\nvar loki = { name: { first: 'Loki' }, age: 2 };\nvar jane = { name: { first: 'Jane' }, age: 6 };\n\nvar users = [tobi, loki, jane];\n\nvar user = users.filter(_(loki)).pop();\nconsole.log(user);\n// => { name: { first: 'Loki' }, age: 2 }\n```\n\n### Expressions\n\n```js\nvar _ = require('..');\n\nvar users = [\n  { name: { first: 'Tobi' }, age: 2 },\n  { name: { first: 'Loki' }, age: 2 },\n  { name: { first: 'Jane' }, age: 6 }\n];\n\nvar oldPets = users.filter(_('age > 2 && age < 10'));\nconsole.log(oldPets);\n// => [ { name: { first: 'Jane' }, age: 6 } ]\n```\n\n### Regular expressions\n\n```js\nvar _ = require('..');\n\nvar users = [\n  'Tobi',\n  'Loki',\n  'Jane'\n];\n\nvar t = users.filter(_(/^T/));\n\nconsole.log(t);\n// => [ 'Tobi' ]\n```\n\n### Nesting\n\n```js\nvar _ = require('..');\n\nvar users = [\n  { name: { first: 'Tobi', last: 'Ferret' }, age: 2 },\n  { name: { first: 'Loki', last: 'Ferret' }, age: 2 },\n  { name: { first: 'Luna', last: 'Cat' }, age: 2 },\n  { name: { first: 'Manny', last: 'Cat' }, age: 3 }\n];\n\n// single-key\n\nvar query = _({\n  name: {\n    last: 'Cat'\n  }\n});\n\nconsole.log(users.filter(query));\n// => [ { name: { first: 'Luna', last: 'Cat' }, age: 2 },\n//      { name: { first: 'Manny', last: 'Cat' }, age: 3 } ]\n\n// multi-key\n\nvar query = _({\n  name: {\n    first: /^L/,\n    last: 'Cat'\n  }\n});\n\nconsole.log(users.filter(query));\n// => [ { name: { first: 'Luna', last: 'Cat' }, age: 2 } ]\n\n// multi-level\n\nvar query = _({\n  name: { last: 'Cat' },\n  age: 3\n});\n\nconsole.log(users.filter(query));\n// => [ { name: { first: 'Manny', last: 'Cat' }, age: 3 } ]\n```\n\n## License\n\n  MIT\n","_attachments":{},"homepage":"https://github.com/component/to-function","bugs":{"url":"https://github.com/component/to-function/issues"}}