mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-12 19:26:13 +09:00
Clean up the oopsie. Rebuild the blank exercises.
This commit is contained in:
+5
-2
@@ -8,7 +8,7 @@ Useful when you wrap a function in another function and like to preserve the ori
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save mimic-fn
|
||||
$ npm install mimic-fn
|
||||
```
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ function foo() {}
|
||||
foo.unicorn = '🦄';
|
||||
|
||||
function wrapper() {
|
||||
return foo() {};
|
||||
return foo();
|
||||
}
|
||||
|
||||
console.log(wrapper.name);
|
||||
@@ -43,6 +43,8 @@ It will copy over the properties `name`, `length`, `displayName`, and any custom
|
||||
|
||||
### mimicFn(to, from)
|
||||
|
||||
Modifies the `to` function and returns it.
|
||||
|
||||
#### to
|
||||
|
||||
Type: `Function`
|
||||
@@ -59,6 +61,7 @@ Function to mimic.
|
||||
## Related
|
||||
|
||||
- [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function
|
||||
- [keep-func-props](https://github.com/ehmicky/keep-func-props) - Wrap a function without changing its name, length and other properties
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Reference in New Issue
Block a user