Make a callback- or promise-based function support both promises and callbacks.
fromCallback
(#12).Thanks to @joepie91 for submitting the fixes for this release!
Bugfix
Do not pass callback to promise functions; to prevent breaking functions with optional parameters.
Add engines
field to package.json
Bugfix
Previously, if you universalify.fromPromise()
ed a function, and called it with a callback that contained an error (as is common with mocha tests), universalify
would call the callback again with the error when the callback threw.
Now errors will cause an unhandled promise rejection (which is OK, because normally a callback error causes an unhandled rejection).
universalified functions now have their name
attribute preserved