artdaq_node_server  v1_00_07
 All Classes Namespaces Files Variables Pages
_composeArgs.js
1 /* Built-in method references for those with the same name as other `lodash` methods. */
2 var nativeMax = Math.max;
3 
15 function composeArgs(args, partials, holders, isCurried) {
16  var argsIndex = -1,
17  argsLength = args.length,
18  holdersLength = holders.length,
19  leftIndex = -1,
20  leftLength = partials.length,
21  rangeLength = nativeMax(argsLength - holdersLength, 0),
22  result = Array(leftLength + rangeLength),
23  isUncurried = !isCurried;
24 
25  while (++leftIndex < leftLength) {
26  result[leftIndex] = partials[leftIndex];
27  }
28  while (++argsIndex < holdersLength) {
29  if (isUncurried || argsIndex < argsLength) {
30  result[holders[argsIndex]] = args[argsIndex];
31  }
32  }
33  while (rangeLength--) {
34  result[leftIndex++] = args[argsIndex++];
35  }
36  return result;
37 }
38 
39 module.exports = composeArgs;