{"_id":"@arsatir/mimic-fn","_rev":"2-32020fc681d010739f5ffc183983fa5c","name":"@arsatir/mimic-fn","dist-tags":{"latest":"3.1.1"},"versions":{"3.1.0":{"name":"@arsatir/mimic-fn","version":"3.1.0","keywords":["function","mimic","imitate","rename","copy","inherit","properties","name","func","fn","set","infer","change"],"license":"MIT","_id":"@arsatir/mimic-fn@3.1.0","maintainers":[{"name":"arsatir","email":"arsajackarsa@gmail.com"}],"homepage":"https://github.com/sindresorhus/mimic-fn#readme","bugs":{"url":"https://github.com/sindresorhus/mimic-fn/issues"},"dist":{"shasum":"3d3dde04b795d1d6c608f455941fd589f4f5d002","tarball":"https://registry.npmjs.org/@arsatir/mimic-fn/-/mimic-fn-3.1.0.tgz","fileCount":5,"integrity":"sha512-YYYXvztOM7yXgH/4GLjaaLDRPHcaVlcnQZ0QB0UuEJh9w/9Y7x8sSWWtH6kPlH1qoJDRArkdhg1ek/9D5Ym2hQ==","signatures":[{"sig":"MEUCIQDU+1HISj7PQLr9H5HPfYwjCgFRlwu/PzFGgQiJnmbPhAIgKlwjlfZTPk+QM2rTu8n4CNE1JSrE9dI0pRffFJIkTf0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8144},"types":"./index.d.ts","engines":{"node":">=8"},"gitHead":"56f672da5c47a7f3a27a41950de84d6fd2cd4499","scripts":{"test":"xo && ava && tsd"},"_npmUser":{"name":"arsatir","email":"arsajackarsa@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/mimic-fn.git","type":"git"},"_npmVersion":"10.8.2","description":"Make a function mimic another one","directories":{},"_nodeVersion":"20.17.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.24.0","ava":"^2.1.0","tsd":"^0.7.1"},"_npmOperationalInternal":{"tmp":"tmp/mimic-fn_3.1.0_1766394148846_0.5353769127295587","host":"s3://npm-registry-packages-npm-production"}},"3.1.1":{"name":"@arsatir/mimic-fn","version":"3.1.1","description":"Make a function mimic another one","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/mimic-fn.git"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["function","mimic","imitate","rename","copy","inherit","properties","name","func","fn","set","infer","change"],"devDependencies":{"ava":"^2.1.0","tsd":"^0.7.1","xo":"^0.24.0"},"_id":"@arsatir/mimic-fn@3.1.1","gitHead":"ed3478e9ea5cdf37e5d117a9aced88053b44ffdd","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/mimic-fn/issues"},"homepage":"https://github.com/sindresorhus/mimic-fn#readme","_nodeVersion":"22.21.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-A4rKAQRoy7X0s9zVWduJl6HOur9+umXJjei4qkqSjlT3AjIFKS3tSQBBNBDBAz554zjYzkfqlOea3C2vSjPicw==","shasum":"c40e829366e8080a96849516a4f13a935b3c9a4a","tarball":"https://registry.npmjs.org/@arsatir/mimic-fn/-/mimic-fn-3.1.1.tgz","fileCount":5,"unpackedSize":8144,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFysTzb6tfgft0dmFSK/jHyzP2AMkybPeJGNgNCn4N14AiEA5abobLshq5Lworv4IqhAJpfsbhohqs8vImr35ZWbAYI="}]},"_npmUser":{"name":"arsatir","email":"arsajackarsa@gmail.com"},"directories":{},"maintainers":[{"name":"arsatir","email":"arsajackarsa@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mimic-fn_3.1.1_1766458655562_0.11807858584649966"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-22T09:02:28.744Z","modified":"2025-12-23T02:57:35.936Z","3.1.0":"2025-12-22T09:02:28.982Z","3.1.1":"2025-12-23T02:57:35.727Z"},"bugs":{"url":"https://github.com/sindresorhus/mimic-fn/issues"},"license":"MIT","homepage":"https://github.com/sindresorhus/mimic-fn#readme","keywords":["function","mimic","imitate","rename","copy","inherit","properties","name","func","fn","set","infer","change"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/mimic-fn.git"},"description":"Make a function mimic another one","maintainers":[{"name":"arsatir","email":"arsajackarsa@gmail.com"}],"readme":"<img src=\"media/logo.svg\" alt=\"mimic-fn\" width=\"400\">\n<br>\n\n[![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 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\nconsole.log(String(wrapper));\n//=> '/* Wrapped with wrapper() */\\nfunction foo() {}'\n```\n\n\n## API\n\n### mimicFn(to, from, options?)\n\nModifies the `to` function to mimic the `from` function. Returns the `to` function.\n\n`name`, `displayName`, and any other properties of `from` are copied. The `length` property is not copied. Prototype, class, and inherited properties are copied.\n\n`to.toString()` will return the same as `from.toString()` but prepended with a `Wrapped with to()` comment.\n\n#### to\n\nType: `Function`\n\nMimicking function.\n\n#### from\n\nType: `Function`\n\nFunction to mimic.\n\n#### options\n\nType: `object`\n\n##### ignoreNonConfigurable\n\nType: `boolean`<br>\nDefault: `false`\n\nSkip modifying [non-configurable properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor#Description) instead of throwing an error.\n\n## Related\n\n- [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function\n- [keep-func-props](https://github.com/ehmicky/keep-func-props) - Wrap a function without changing its name and other properties\n\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-mimic-fn?utm_source=npm-mimic-fn&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n","readmeFilename":"readme.md"}