Urara-Blog/node_modules/.pnpm-store/v3/files/c8/f3ab801aa97bc4a3813b5f82de0ca4a8a815fb9a0c156110caa1e4237c5dddf8794c7514851e5105f27da6f8c85cc9e38a53d652fcf7f69ba6b8c3be007e19
2022-08-14 01:14:53 +08:00

15 lines
382 B
Text

/**
* 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 function(arg) {
return func(transform(arg));
};
}
module.exports = overArg;