Sha256: 28808649a653c40a4983ea61110e3e1ba70d638bba05c92d4b2513544402f9eb

Contents?: true

Size: 1.29 KB

Versions: 302

Compression:

Stored size: 1.29 KB

Contents

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;

/**
 * Creates an array that is the composition of partially applied arguments,
 * placeholders, and provided arguments into a single array of arguments.
 *
 * @private
 * @param {Array} args The provided arguments.
 * @param {Array} partials The arguments to prepend to those provided.
 * @param {Array} holders The `partials` placeholder indexes.
 * @params {boolean} [isCurried] Specify composing for a curried function.
 * @returns {Array} Returns the new array of composed arguments.
 */
function composeArgs(args, partials, holders, isCurried) {
  var argsIndex = -1,
      argsLength = args.length,
      holdersLength = holders.length,
      leftIndex = -1,
      leftLength = partials.length,
      rangeLength = nativeMax(argsLength - holdersLength, 0),
      result = Array(leftLength + rangeLength),
      isUncurried = !isCurried;

  while (++leftIndex < leftLength) {
    result[leftIndex] = partials[leftIndex];
  }
  while (++argsIndex < holdersLength) {
    if (isUncurried || argsIndex < argsLength) {
      result[holders[argsIndex]] = args[argsIndex];
    }
  }
  while (rangeLength--) {
    result[leftIndex++] = args[argsIndex++];
  }
  return result;
}

module.exports = composeArgs;

Version data entries

302 entries across 279 versions & 33 rubygems

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