1 var baseFlatten = require('./_baseFlatten'),
2 createWrapper = require('./_createWrapper'),
3 rest = require('./rest');
5 /** Used to compose bitmasks for wrapper metadata. */
9 * Creates a function that invokes `func` with arguments arranged according
10 * to the specified indexes where the argument value at the first index is
11 * provided as the first argument, the argument value at the second index is
12 * provided as the second argument, and so on.
17 * @param {Function} func The function to rearrange arguments for.
18 * @param {...(number|number[])} indexes The arranged argument indexes,
19 * specified individually or in arrays.
20 * @returns {Function} Returns the new function.
23 * var rearged = _.rearg(function(a, b, c) {
27 * rearged('b', 'c', 'a')
28 * // => ['a', 'b', 'c']
30 var rearg = rest(function(func, indexes) {
31 return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
34 module.exports = rearg;