basant307/AI_Governance_Project
048
1import baseRest from './_baseRest.js';2import createWrap from './_createWrap.js';3import getHolder from './_getHolder.js';4import replaceHolders from './_replaceHolders.js';5 6/** Used to compose bitmasks for function metadata. */7var WRAP_PARTIAL_RIGHT_FLAG = 64;8 9/**10 * This method is like `_.partial` except that partially applied arguments11 * are appended to the arguments it receives.12 *13 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic14 * builds, may be used as a placeholder for partially applied arguments.15 *16 * **Note:** This method doesn't set the "length" property of partially17 * applied functions.18 *19 * @static20 * @memberOf _21 * @since 1.0.022 * @category Function23 * @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.26 * @example27 *28 * function greet(greeting, name) {29 * return greeting + ' ' + name;30 * }31 *32 * var greetFred = _.partialRight(greet, 'fred');33 * greetFred('hi');34 * // => 'hi fred'35 *36 * // Partially applied with placeholders.37 * var sayHelloTo = _.partialRight(greet, 'hello', _);38 * sayHelloTo('fred');39 * // => 'hello fred'40 */41var partialRight = baseRest(function(func, partials) {42 var holders = replaceHolders(partials, getHolder(partialRight));43 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);44});45 46// Assign default placeholders.47partialRight.placeholder = {};48 49export default partialRight;50 