1 var baseRest = require('./_baseRest'),
2 createWrap = require('./_createWrap'),
3 getHolder = require('./_getHolder'),
4 replaceHolders = require('./_replaceHolders');
6 /** Used to compose bitmasks for function metadata. */
7 var PARTIAL_RIGHT_FLAG = 64;
10 * This method is like `_.partial` except that partially applied arguments
11 * are appended to the arguments it receives.
13 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
14 * builds, may be used as a placeholder for partially applied arguments.
16 * **Note:** This method doesn't set the "length" property of partially
23 * @param {Function} func The function to partially apply arguments to.
24 * @param {...*} [partials] The arguments to be partially applied.
25 * @returns {Function} Returns the new partially applied function.
28 * function greet(greeting, name) {
29 * return greeting + ' ' + name;
32 * var greetFred = _.partialRight(greet, 'fred');
36 * // Partially applied with placeholders.
37 * var sayHelloTo = _.partialRight(greet, 'hello', _);
41 var partialRight = baseRest(function(func, partials) {
42 var holders = replaceHolders(partials, getHolder(partialRight));
43 return createWrap(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
46 // Assign default placeholders.
47 partialRight.placeholder = {};
49 module.exports = partialRight;