1 var createWrap = require('./_createWrap');
3 /** Used to compose bitmasks for function metadata. */
4 var WRAP_CURRY_RIGHT_FLAG = 16;
7 * This method is like `_.curry` except that arguments are applied to `func`
8 * in the manner of `_.partialRight` instead of `_.partial`.
10 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
11 * builds, may be used as a placeholder for provided arguments.
13 * **Note:** This method doesn't set the "length" property of curried functions.
19 * @param {Function} func The function to curry.
20 * @param {number} [arity=func.length] The arity of `func`.
21 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
22 * @returns {Function} Returns the new curried function.
25 * var abc = function(a, b, c) {
29 * var curried = _.curryRight(abc);
40 * // Curried with placeholders.
41 * curried(3)(1, _)(2);
44 function curryRight(func, arity, guard) {
45 arity = guard ? undefined : arity;
46 var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
47 result.placeholder = curryRight.placeholder;
51 // Assign default placeholders.
52 curryRight.placeholder = {};
54 module.exports = curryRight;