react / wstein / node_modules / jest-cli / node_modules / istanbul / node_modules / js-yaml / node_modules / argparse / node_modules / lodash / function / curry.js
80742 viewsvar createCurry = require('../internal/createCurry');12/** Used to compose bitmasks for wrapper metadata. */3var CURRY_FLAG = 8;45/**6* Creates a function that accepts one or more arguments of `func` that when7* called either invokes `func` returning its result, if all `func` arguments8* have been provided, or returns a function that accepts one or more of the9* remaining `func` arguments, and so on. The arity of `func` may be specified10* if `func.length` is not sufficient.11*12* The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,13* may be used as a placeholder for provided arguments.14*15* **Note:** This method does not set the "length" property of curried functions.16*17* @static18* @memberOf _19* @category Function20* @param {Function} func The function to curry.21* @param {number} [arity=func.length] The arity of `func`.22* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.23* @returns {Function} Returns the new curried function.24* @example25*26* var abc = function(a, b, c) {27* return [a, b, c];28* };29*30* var curried = _.curry(abc);31*32* curried(1)(2)(3);33* // => [1, 2, 3]34*35* curried(1, 2)(3);36* // => [1, 2, 3]37*38* curried(1, 2, 3);39* // => [1, 2, 3]40*41* // using placeholders42* curried(1)(_, 3)(2);43* // => [1, 2, 3]44*/45var curry = createCurry(CURRY_FLAG);4647// Assign default placeholders.48curry.placeholder = {};4950module.exports = curry;515253