wrap.js 313 B

12345678910
  1. var partial = require('./partial.js');
  2. // Returns the first function passed as an argument to the second,
  3. // allowing you to adjust arguments, run code before and after, and
  4. // conditionally execute the original function.
  5. function wrap(func, wrapper) {
  6. return partial(wrapper, func);
  7. }
  8. module.exports = wrap;