mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-28 13:13:37 +08:00
This CL contains the output of running `npm run install-deps` on NPM 7.4.5. This includes a version bump of the package-lock.json, which means all DevTools engineers who run `npm run install-deps` should use NPM 7+. Additionally, this allows `npm run dedupe` to produce a better output and remove more duplicate packages. For more information, see https://github.com/eslint/eslint/issues/14098 DISABLE_THIRD_PARTY_CHECK=NPM update R=jacktfranklin@chromium.org Bug: none Change-Id: Id1ca2f33f3bb7d555dca1c0737d38bc1c7f5221c Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2705386 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
50 lines
1.5 KiB
JavaScript
50 lines
1.5 KiB
JavaScript
var arrayMap = require('./_arrayMap'),
|
|
baseGet = require('./_baseGet'),
|
|
baseIteratee = require('./_baseIteratee'),
|
|
baseMap = require('./_baseMap'),
|
|
baseSortBy = require('./_baseSortBy'),
|
|
baseUnary = require('./_baseUnary'),
|
|
compareMultiple = require('./_compareMultiple'),
|
|
identity = require('./identity'),
|
|
isArray = require('./isArray');
|
|
|
|
/**
|
|
* The base implementation of `_.orderBy` without param guards.
|
|
*
|
|
* @private
|
|
* @param {Array|Object} collection The collection to iterate over.
|
|
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
|
|
* @param {string[]} orders The sort orders of `iteratees`.
|
|
* @returns {Array} Returns the new sorted array.
|
|
*/
|
|
function baseOrderBy(collection, iteratees, orders) {
|
|
if (iteratees.length) {
|
|
iteratees = arrayMap(iteratees, function(iteratee) {
|
|
if (isArray(iteratee)) {
|
|
return function(value) {
|
|
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
|
}
|
|
}
|
|
return iteratee;
|
|
});
|
|
} else {
|
|
iteratees = [identity];
|
|
}
|
|
|
|
var index = -1;
|
|
iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
|
|
|
|
var result = baseMap(collection, function(value, key, collection) {
|
|
var criteria = arrayMap(iteratees, function(iteratee) {
|
|
return iteratee(value);
|
|
});
|
|
return { 'criteria': criteria, 'index': ++index, 'value': value };
|
|
});
|
|
|
|
return baseSortBy(result, function(object, other) {
|
|
return compareMultiple(object, other, orders);
|
|
});
|
|
}
|
|
|
|
module.exports = baseOrderBy;
|