UNPKG

353 BJavaScriptView Raw
1var partial = require('./partial');
2
3 /**
4 * Returns the first function passed as an argument to the second,
5 * allowing you to adjust arguments, run code before and after, and
6 * conditionally execute the original function.
7 */
8 function wrap(fn, wrapper){
9 return partial(wrapper, fn);
10 }
11
12 module.exports = wrap;
13
14