mimic-function

Make a function mimic another one

MIT License

Downloads
16.4M
Stars
90
Committers
11

Bot releases are hidden (Show)

mimic-function - Latest Release

Published by sindresorhus 7 months ago

  • Fix composition with non-value .toString descriptors (#51) d4d3e62

https://github.com/sindresorhus/mimic-function/compare/v5.0.0...v5.0.1

mimic-function -

Published by sindresorhus 12 months ago

Breaking

  • Rename package from mimic-fn to mimic-function 1692df8
  • Require Node.js 18 (#48) 11cd91c

https://github.com/sindresorhus/mimic-fn/compare/v4.0.0...v5.0.0

mimic-function -

Published by sindresorhus over 3 years ago

Breaking

  • Require Node.js 12 08c06ad
  • This package is now pure ESM. Please read this.

https://github.com/sindresorhus/mimic-fn/compare/v3.1.0...v4.0.0

mimic-function -

Published by sindresorhus about 4 years ago

  • Improve React Native compatibility (#41) 260d6e3

https://github.com/sindresorhus/mimic-fn/compare/v3.0.0...v3.1.0

mimic-function -

Published by ehmicky over 5 years ago

Breaking changes

  • Copy inherited properties of the original function. (#30)
  • Do not copy the length property. (#23)
  • Drop support for Node 6. (#25)
  • Remove module.exports.default. (#26) If you used to do require('mimic-fn').default, you should now use require('mimic-fn') directly.

Features

  • String(wrapper) now mimics String(originalFunction). A comment is prepended to indicate the original function has been wrapped. (#32)
  • Add boolean option ignoreNonConfigurable to ignore the wrapper function's non-configurable properties instead of throwing an error. This defaults to false. (#33, #34, #35)
  • Allow functions with different prototype such as classes, constructor functions and arrow functions. (#31, #36)

Design

  • Add a logo. (#37)

Maintainers

  • Add @ehmicky as an additional maintainer.
mimic-function -

Published by sindresorhus over 5 years ago

  • Refactor TypeScript definition to CommonJS compatible export (#20) 0c3d690

https://github.com/sindresorhus/mimic-fn/compare/v2.0.0...v2.1.0

mimic-function -

Published by sindresorhus over 5 years ago

Breaking:

  • Require Node.js 6 (#9) 7751dc7

Enhancements:

  • Add TypeScript definition (#14) eeaf3fb

https://github.com/sindresorhus/mimic-fn/compare/v1.2.0...v2.0.0