REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.03 KB
Close
/opt/alt/alt-nodejs11/root/lib/node_modules/npm/node_modules/mimic-fn/readme.md
Text
Base64
# mimic-fn [](https://travis-ci.org/sindresorhus/mimic-fn) > Make a function mimic another one Useful when you wrap a function in another function and like to preserve the original name and other properties. ## Install ``` $ npm install mimic-fn ``` ## Usage ```js const mimicFn = require('mimic-fn'); function foo() {} foo.unicorn = '🦄'; function wrapper() { return foo() {}; } console.log(wrapper.name); //=> 'wrapper' mimicFn(wrapper, foo); console.log(wrapper.name); //=> 'foo' console.log(wrapper.unicorn); //=> '🦄' ``` ## API It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set. ### mimicFn(to, from) It will modify `to` and return it. #### to Type: `Function` Mimicking function. #### from Type: `Function` Function to mimic. ## Related - [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function ## License MIT © [Sindre Sorhus](https://sindresorhus.com)
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
index.js
304 B
lrw-r--r--
2021-10-19 09:47:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
license
1.08 KB
lrw-r--r--
2021-10-19 09:47:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
1.61 KB
lrw-r--r--
2021-10-19 09:47:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
readme.md
1.03 KB
lrw-r--r--
2021-10-19 09:47:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).