'use strict';

var flatten = require('./flatten.js');
var _overRest = require('./_overRest.js');
var _setToString = require('./_setToString.js');

/**
 * A specialized version of `baseRest` which flattens the rest array.
 *
 * @private
 * @param {Function} func The function to apply a rest parameter to.
 * @returns {Function} Returns the new function.
 */
function flatRest(func) {
  return _setToString(_overRest(func, undefined, flatten), func + '');
}

module.exports = flatRest;
