1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import baseOrderBy from './_baseOrderBy.js';
- import isArray from './isArray.js';
- 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);
- }
- export default orderBy;
|