您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

_overArg.js 382B

123456789101112131415
  1. /**
  2. * Creates a unary function that invokes `func` with its argument transformed.
  3. *
  4. * @private
  5. * @param {Function} func The function to wrap.
  6. * @param {Function} transform The argument transform.
  7. * @returns {Function} Returns the new function.
  8. */
  9. function overArg(func, transform) {
  10. return function(arg) {
  11. return func(transform(arg));
  12. };
  13. }
  14. module.exports = overArg;