(users, orderBy)
| 352 | } |
| 353 | |
| 354 | function applySorting(users, orderBy) { |
| 355 | if (!orderBy) { |
| 356 | return users; |
| 357 | } |
| 358 | |
| 359 | return [...users].sort((left, right) => { |
| 360 | const direction = orderBy.sort === 'asc' ? 1 : -1; |
| 361 | return compareValues(left[orderBy.field], right[orderBy.field]) * direction; |
| 362 | }); |
| 363 | } |
| 364 | |
| 365 | function applyPagination(users, filter, requestQuery) { |
| 366 | const limit = toPositiveInteger(filter.limit ?? pickQueryValue(requestQuery.limit), 10); |
no test coverage detected