Wrap a JavaScript function without changing its name/properties (by sindresorhus)

github logo ・1 min read

Wrapping a JavaScript function is not as simple as one might think. Some of the issues you might encounter include:

  • keeping the original function name
  • keeping the original function static properties and inherited properties
  • showing the original function's body when using String(function)

mimic-fn is a small utility by sindresorhus tackling this issue.

https://github.com/sindresorhus/mimic-fn

twitter logo DISCUSS
Classic DEV Post from Mar 20

JavaScript predictions for 2019 by npm

npm, Inc., which runs the world’s biggest software registry has shared some very interesting read about insights and predictions about JavaScript for 2019

ehmicky profile image

Sore eyes?

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❀️