Skip to content

Commit

Permalink
Upgrade mimic-function
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Oct 29, 2023
1 parent efa7b0f commit 3bf8047
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 7.1.0

## Dependencies

- Upgrade `mimic-function`

# 7.0.0

## Breaking changes
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ A function `wrapper` is passed as argument. A copy of it is returned.

# See also

- [`mimic-fn`](https://github.com/sindresorhus/mimic-fn): same but for functions
that do not wrap other functions.
- [`mimic-function`](https://github.com/sindresorhus/mimic-function): same but
for functions that do not wrap other functions.

# Support

Expand Down
14 changes: 13 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"lib": "src"
},
"dependencies": {
"mimic-fn": "^4.0.0"
"mimic-function": "^5.0.0"
},
"devDependencies": {
"@ehmicky/dev-tasks": "^2.0.103",
Expand Down
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mimicFn from 'mimic-fn'
import mimicFunction from 'mimic-function'

// Wraps a functor so it does not modify a function `name`, etc.
const keepFuncProps = (functor) => {
Expand All @@ -11,7 +11,7 @@ const keepFuncProps = (functor) => {
const newFunc = functor.call(this, func, ...args)

if (typeof func === 'function' && typeof newFunc === 'function') {
mimicFn(newFunc, func, { ignoreNonConfigurable: true })
mimicFunction(newFunc, func, { ignoreNonConfigurable: true })
}

return newFunc
Expand Down

0 comments on commit 3bf8047

Please sign in to comment.