• File: _baseRest.js
  • Full Path: /var/www/nodejs/callDir/node_modules/lodash/_baseRest.js
  • Date Modified: 06/03/2024 5:11 PM
  • File size: 559 bytes
  • MIME-type: text/plain
  • Charset: utf-8
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;