Sha256: 991efe2459c0484db4ab4243d978be7ce464756a3ceb680702ec37107688d014

Contents?: true

Size: 1.52 KB

Versions: 273

Compression:

Stored size: 1.52 KB

Contents

var baseRest = require('./_baseRest'),
    createWrap = require('./_createWrap'),
    getHolder = require('./_getHolder'),
    replaceHolders = require('./_replaceHolders');

/** Used to compose bitmasks for function metadata. */
var WRAP_PARTIAL_RIGHT_FLAG = 64;

/**
 * This method is like `_.partial` except that partially applied arguments
 * are appended to the arguments it receives.
 *
 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
 * builds, may be used as a placeholder for partially applied arguments.
 *
 * **Note:** This method doesn't set the "length" property of partially
 * applied functions.
 *
 * @static
 * @memberOf _
 * @since 1.0.0
 * @category Function
 * @param {Function} func The function to partially apply arguments to.
 * @param {...*} [partials] The arguments to be partially applied.
 * @returns {Function} Returns the new partially applied function.
 * @example
 *
 * function greet(greeting, name) {
 *   return greeting + ' ' + name;
 * }
 *
 * var greetFred = _.partialRight(greet, 'fred');
 * greetFred('hi');
 * // => 'hi fred'
 *
 * // Partially applied with placeholders.
 * var sayHelloTo = _.partialRight(greet, 'hello', _);
 * sayHelloTo('fred');
 * // => 'hello fred'
 */
var partialRight = baseRest(function(func, partials) {
  var holders = replaceHolders(partials, getHolder(partialRight));
  return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
});

// Assign default placeholders.
partialRight.placeholder = {};

module.exports = partialRight;

Version data entries

273 entries across 272 versions & 29 rubygems

Version Path
rapid_stack-0.2.0 templates/frontend/node_modules/lodash/partialRight.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/lodash/partialRight.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/lodash/partialRight.js
immosquare-cleaner-0.1.60 node_modules/lodash/partialRight.js
immosquare-cleaner-0.1.59 node_modules/lodash/partialRight.js
immosquare-cleaner-0.1.58 node_modules/lodash/partialRight.js
immosquare-cleaner-0.1.57 node_modules/lodash/partialRight.js
immosquare-cleaner-0.1.56 node_modules/lodash/partialRight.js
immosquare-cleaner-0.1.55 node_modules/lodash/partialRight.js
immosquare-cleaner-0.1.54 node_modules/lodash/partialRight.js
immosquare-cleaner-0.1.53 node_modules/lodash/partialRight.js
immosquare-cleaner-0.1.52 node_modules/lodash/partialRight.js
trusty-cms-6.3.1 node_modules/lodash/partialRight.js
immosquare-cleaner-0.1.51 node_modules/lodash/partialRight.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/partialRight.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/partialRight.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/partialRight.js
immosquare-cleaner-0.1.50 node_modules/lodash/partialRight.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/partialRight.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/partialRight.js