UNPKG

pnpm

Version:

Fast, disk space efficient package manager

116 lines (115 loc) 4.93 kB
{ "_args": [ [ { "raw": "mimic-fn@^2.0.0", "scope": null, "escapedName": "mimic-fn", "name": "mimic-fn", "rawSpec": "^2.0.0", "spec": ">=2.0.0 <3.0.0", "type": "range" }, "/home/zoltan/src/pnpm/pnpm/packages/pnpm/node_modules/mem" ] ], "_from": "mimic-fn@^2.0.0", "_hasShrinkwrap": false, "_id": "mimic-fn@2.1.0", "_location": "/mimic-fn", "_nodeVersion": "8.15.0", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mimic-fn_2.1.0_1554054813982_0.46010347442389166" }, "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "_npmVersion": "6.9.0", "_phantomChildren": {}, "_requested": { "raw": "mimic-fn@^2.0.0", "scope": null, "escapedName": "mimic-fn", "name": "mimic-fn", "rawSpec": "^2.0.0", "spec": ">=2.0.0 <3.0.0", "type": "range" }, "_requiredBy": [ "/mem" ], "_resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "_shasum": "7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b", "_shrinkwrap": null, "_spec": "mimic-fn@^2.0.0", "_where": "/home/zoltan/src/pnpm/pnpm/packages/pnpm/node_modules/mem", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bugs": { "url": "https://github.com/sindresorhus/mimic-fn/issues" }, "dependencies": {}, "description": "Make a function mimic another one", "devDependencies": { "ava": "^1.4.1", "tsd": "^0.7.1", "xo": "^0.24.0" }, "directories": {}, "dist": { "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "shasum": "7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b", "tarball": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "fileCount": 5, "unpackedSize": 4457, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcoP6eCRA9TVsSAnZWagAABhUP/0r53cJjmLHgRJsHmF5j\nVbo/ZfYjnaYVOtWnhLMqKckmQyZwFrlWnVqgvpAX+9zT4mwWQrs9b5BklbRH\nEW0EnFbfov2GtzngwpLlEFu1I8zCcwtSNgXFLjC2zRBIyoZwfMcmR8AnVXVE\nYeKl7lpF+k2UO6e6qBqaTfOyiHfaT2KqGHgrojvi2807BNL+mAiwt/HOA+A/\nj47kuPGK3gwvfoXqU0FFHtvx8/cF4KxJuL2bOqOfJRFMvDYzszIn9hMsODMN\nivLzdtqU2KN4GVALWdgIgmBOiivCvQWfeveJpN+FCGS+tqhI8pA++jai5Bc9\noplfu08LTp44MxEWNqA/4ZvYNtGqdDhfuCbkYJfWs1JVsdMiy+/+GjOg9GSr\nuMAvgO7xCjg/4bmt5xhGRf458zNHcK85M0N6E4bTZUCnUlpmwVtNYyv5IG0r\nKANhkq2vRyzb6XbNgWgaTuV75EA/qtlF2aM3MJqn0abyfOb/KbsADYNFLF13\nYnWKZLL0zyIzNTa8yMggOa4hIM+qczWoPbxXQYWNUKjheFWw4Z0HXJG9DiN5\nLe0CBrtqUB9RNuFSPpfySoGQZ26iGeLTVMCYSouoednp/5iqD5/uKcRqhmEE\nZ/LhXFoCea95amej1cFLV/4kKp8XnY2aN8cmawYtTTTL8QKpro534KGlPg0h\nYOd+\r\n=2q3H\r\n-----END PGP SIGNATURE-----\r\n" }, "engines": { "node": ">=6" }, "files": [ "index.js", "index.d.ts" ], "gitHead": "d29f5387f4c19814a042d03a780ff4481ceac5a3", "homepage": "https://github.com/sindresorhus/mimic-fn#readme", "keywords": [ "function", "mimic", "imitate", "rename", "copy", "inherit", "properties", "name", "func", "fn", "set", "infer", "change" ], "license": "MIT", "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "name": "mimic-fn", "optionalDependencies": {}, "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 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\nModifies the `to` function and returns it.\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- [keep-func-props](https://github.com/ehmicky/keep-func-props) - Wrap a function without changing its name, length and other properties\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n", "readmeFilename": "readme.md", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mimic-fn.git" }, "scripts": { "test": "xo && ava && tsd" }, "version": "2.1.0" }