Files
lodash/_overArg.js
2017-01-06 15:41:39 -08:00

14 lines
355 B
JavaScript

/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return arg => func(transform(arg));
}
export default overArg;