mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-21 05:24:45 +00:00
.
This commit is contained in:
parent
fc725ba36b
commit
422b9fdb15
7395 changed files with 1786235 additions and 3476 deletions
47
node_modules/lodash/orderBy.js
generated
vendored
Normal file
47
node_modules/lodash/orderBy.js
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
var baseOrderBy = require('./_baseOrderBy'),
|
||||
isArray = require('./isArray');
|
||||
|
||||
/**
|
||||
* This method is like `_.sortBy` except that it allows specifying the sort
|
||||
* orders of the iteratees to sort by. If `orders` is unspecified, all values
|
||||
* are sorted in ascending order. Otherwise, specify an order of "desc" for
|
||||
* descending or "asc" for ascending sort order of corresponding values.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Collection
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @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.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'fred', 'age': 48 },
|
||||
* { 'user': 'barney', 'age': 34 },
|
||||
* { 'user': 'fred', 'age': 40 },
|
||||
* { 'user': 'barney', 'age': 36 }
|
||||
* ];
|
||||
*
|
||||
* // Sort by `user` in ascending order and by `age` in descending order.
|
||||
* _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
|
||||
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
|
||||
*/
|
||||
function orderBy(collection, iteratees, orders, guard) {
|
||||
if (collection == null) {
|
||||
return [];
|
||||
}
|
||||
if (!isArray(iteratees)) {
|
||||
iteratees = iteratees == null ? [] : [iteratees];
|
||||
}
|
||||
orders = guard ? undefined : orders;
|
||||
if (!isArray(orders)) {
|
||||
orders = orders == null ? [] : [orders];
|
||||
}
|
||||
return baseOrderBy(collection, iteratees, orders);
|
||||
}
|
||||
|
||||
module.exports = orderBy;
|
Loading…
Add table
Add a link
Reference in a new issue