Apply rest arguments transform.

This commit is contained in:
John-David Dalton
2017-01-06 15:49:42 -08:00
parent f4a6e9ede9
commit bf54267f0b
7 changed files with 15 additions and 15 deletions

View File

@@ -33,11 +33,11 @@ import isArray from './isArray.js';
* console.log(_.castArray(array) === array);
* // => true
*/
function castArray() {
if (!arguments.length) {
function castArray(...args) {
if (!args.length) {
return [];
}
var value = arguments[0];
var value = args[0];
return isArray(value) ? value : [value];
}