{"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"keywords":["function","mimic","imitate","rename","copy","inherit","properties","name","func","fn","set","infer","change"],"dist-tags":{"latest":"1.1.0"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"description":"Make a function mimic another one","readme":"# mimic-fn [![Build Status](https://travis-ci.org/sindresorhus/mimic-fn.svg?branch=master)](https://travis-ci.org/sindresorhus/mimic-fn)\n\n> Make a function mimic another one\n\nUseful when you wrap a function in another function and like to preserve the original name and other properties.\n\n\n## Install\n\n```\n$ npm install --save mimic-fn\n```\n\n\n## Usage\n\n```js\nconst mimicFn = require('mimic-fn');\n\nfunction foo() {}\nfoo.unicorn = '🦄';\n\nfunction wrapper() {\n\treturn foo() {};\n}\n\nconsole.log(wrapper.name);\n//=> 'wrapper'\n\nmimicFn(wrapper, foo);\n\nconsole.log(wrapper.name);\n//=> 'foo'\n\nconsole.log(wrapper.unicorn);\n//=> '🦄'\n```\n\n\n## API\n\nIt will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set.\n\n### mimicFn(to, from)\n\n#### to\n\nType: `Function`\n\nMimicking function.\n\n#### from\n\nType: `Function`\n\nFunction to mimic.\n\n\n## Related\n\n- [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","repository":{"type":"git","url":"git+https://github.com/sindresorhus/mimic-fn.git"},"bugs":{"url":"https://github.com/sindresorhus/mimic-fn/issues"},"license":"MIT","versions":{"1.0.0":{"name":"mimic-fn","version":"1.0.0","description":"Make a function mimic another one","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/mimic-fn.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["function","mimic","imitate","rename","copy","inherit","properties","name","func","fn","set","infer","change"],"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"aa6ed7d5bd448aacfb68b249362e2997ca969696","bugs":{"url":"https://github.com/sindresorhus/mimic-fn/issues"},"homepage":"https://github.com/sindresorhus/mimic-fn#readme","_id":"mimic-fn@1.0.0","_shasum":"93c514dcbfb753539ceb8e7a1f55cbf815580da4","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"93c514dcbfb753539ceb8e7a1f55cbf815580da4","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/mimic-fn/-/mimic-fn-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/mimic-fn-1.0.0.tgz_1476898052705_0.4593465782236308"},"directories":{}},"1.1.0":{"name":"mimic-fn","version":"1.1.0","description":"Make a function mimic another one","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/mimic-fn.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["function","mimic","imitate","rename","copy","inherit","properties","name","func","fn","set","infer","change"],"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"3703ef8142ce6b7170297e58fee1a14799b79975","bugs":{"url":"https://github.com/sindresorhus/mimic-fn/issues"},"homepage":"https://github.com/sindresorhus/mimic-fn#readme","_id":"mimic-fn@1.1.0","_shasum":"e667783d92e89dbd342818b5230b9d62a672ad18","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e667783d92e89dbd342818b5230b9d62a672ad18","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/mimic-fn/-/mimic-fn-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/mimic-fn-1.1.0.tgz_1477992909009_0.6083487698342651"},"directories":{}}},"name":"mimic-fn","time":{"modified":"2016-11-01T09:35:10.608Z","created":"2016-10-19T17:27:32.921Z","1.0.0":"2016-10-19T17:27:32.921Z","1.1.0":"2016-11-01T09:35:10.608Z"},"readmeFilename":"readme.md","homepage":"https://github.com/sindresorhus/mimic-fn#readme"}