Sha256: 7d550bb9e63e95df9a3e337b3b0bd44438794d90ef8473d242fb81a5074f9c76

Contents?: true

Size: 1.46 KB

Versions: 270

Compression:

Stored size: 1.46 KB

Contents

var createWrap = require('./_createWrap');

/** Used to compose bitmasks for function metadata. */
var WRAP_CURRY_RIGHT_FLAG = 16;

/**
 * This method is like `_.curry` except that arguments are applied to `func`
 * in the manner of `_.partialRight` instead of `_.partial`.
 *
 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
 * builds, may be used as a placeholder for provided arguments.
 *
 * **Note:** This method doesn't set the "length" property of curried functions.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Function
 * @param {Function} func The function to curry.
 * @param {number} [arity=func.length] The arity of `func`.
 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
 * @returns {Function} Returns the new curried function.
 * @example
 *
 * var abc = function(a, b, c) {
 *   return [a, b, c];
 * };
 *
 * var curried = _.curryRight(abc);
 *
 * curried(3)(2)(1);
 * // => [1, 2, 3]
 *
 * curried(2, 3)(1);
 * // => [1, 2, 3]
 *
 * curried(1, 2, 3);
 * // => [1, 2, 3]
 *
 * // Curried with placeholders.
 * curried(3)(1, _)(2);
 * // => [1, 2, 3]
 */
function curryRight(func, arity, guard) {
  arity = guard ? undefined : arity;
  var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  result.placeholder = curryRight.placeholder;
  return result;
}

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

module.exports = curryRight;

Version data entries

270 entries across 269 versions & 28 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/lodash/curryRight.js
immosquare-cleaner-0.1.59 node_modules/lodash/curryRight.js
immosquare-cleaner-0.1.58 node_modules/lodash/curryRight.js
immosquare-cleaner-0.1.57 node_modules/lodash/curryRight.js
immosquare-cleaner-0.1.56 node_modules/lodash/curryRight.js
immosquare-cleaner-0.1.55 node_modules/lodash/curryRight.js
immosquare-cleaner-0.1.54 node_modules/lodash/curryRight.js
immosquare-cleaner-0.1.53 node_modules/lodash/curryRight.js
immosquare-cleaner-0.1.52 node_modules/lodash/curryRight.js
trusty-cms-6.3.1 node_modules/lodash/curryRight.js
immosquare-cleaner-0.1.51 node_modules/lodash/curryRight.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/curryRight.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/curryRight.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/curryRight.js
immosquare-cleaner-0.1.50 node_modules/lodash/curryRight.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/curryRight.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/curryRight.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/curryRight.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/lodash/curryRight.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/lodash/curryRight.js