1 /* Built-in method references for those with the same name as other `lodash` methods. */
2 var nativeMax = Math.max;
5 * Creates an array that is the composition of partially applied arguments,
6 * placeholders, and provided arguments into a single array of arguments.
9 * @param {Array|Object} args The provided arguments.
10 * @param {Array} partials The arguments to prepend to those provided.
11 * @param {Array} holders The `partials` placeholder indexes.
12 * @returns {Array} Returns the new array of composed arguments.
14 function composeArgs(args, partials, holders) {
15 var holdersLength = holders.length,
17 argsLength = nativeMax(args.length - holdersLength, 0),
19 leftLength = partials.length,
20 result = Array(leftLength + argsLength);
22 while (++leftIndex < leftLength) {
23 result[leftIndex] = partials[leftIndex];
25 while (++argsIndex < holdersLength) {
26 result[holders[argsIndex]] = args[argsIndex];
28 while (argsLength--) {
29 result[leftIndex++] = args[argsIndex++];
34 module.exports = composeArgs;