Remove guard params.

This commit is contained in:
John-David Dalton
2017-03-05 02:37:18 -08:00
parent 89829331f0
commit bda6d56c60
14 changed files with 22 additions and 41 deletions

View File

@@ -12,7 +12,6 @@ import baseOrderBy from './.internal/baseOrderBy.js'
* @param {Array[]|Function[]|Object[]|string[]} [iteratees=[identity]]
* The iteratees to sort by.
* @param {string[]} [orders] The sort orders of `iteratees`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `reduce`.
* @returns {Array} Returns the new sorted array.
* @see reverse
* @example
@@ -28,14 +27,13 @@ import baseOrderBy from './.internal/baseOrderBy.js'
* orderBy(users, ['user', 'age'], ['asc', 'desc'])
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*/
function orderBy(collection, iteratees, orders, guard) {
function orderBy(collection, iteratees, orders) {
if (collection == null) {
return []
}
if (!Array.isArray(iteratees)) {
iteratees = iteratees == null ? [] : [iteratees]
}
orders = guard ? undefined : orders
if (!Array.isArray(orders)) {
orders = orders == null ? [] : [orders]
}