(users, filter, requestQuery)
| 363 | } |
| 364 | |
| 365 | function applyPagination(users, filter, requestQuery) { |
| 366 | const limit = toPositiveInteger(filter.limit ?? pickQueryValue(requestQuery.limit), 10); |
| 367 | const page = toNonNegativeInteger(filter.page ?? pickQueryValue(requestQuery.page), 0); |
| 368 | const offset = page * limit; |
| 369 | |
| 370 | return users.slice(offset, offset + limit); |
| 371 | } |
| 372 | |
| 373 | function nextId() { |
| 374 | idSequence += 1; |
no test coverage detected