aboutsummaryrefslogtreecommitdiff
path: root/node_modules/lodash/_baseRest.js
blob: d0dc4bdd1f9691559af3b5448e00af26c840c1c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var identity = require('./identity'),
    overRest = require('./_overRest'),
    setToString = require('./_setToString');

/**
 * The base implementation of `_.rest` which doesn't validate or coerce arguments.
 *
 * @private
 * @param {Function} func The function to apply a rest parameter to.
 * @param {number} [start=func.length-1] The start position of the rest parameter.
 * @returns {Function} Returns the new function.
 */
function baseRest(func, start) {
  return setToString(overRest(func, start, identity), func + '');
}

module.exports = baseRest;