MCPcopy Create free account
hub / github.com/flatlogic/react-material-admin / applyPagination

Function applyPagination

src/repositories/usersMockRepository.js:365–371  ·  view source on GitHub ↗
(users, filter, requestQuery)

Source from the content-addressed store, hash-verified

363}
364
365function 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
373function nextId() {
374 idSequence += 1;

Callers 1

listMockUsersFunction · 0.85

Calls 3

toPositiveIntegerFunction · 0.85
pickQueryValueFunction · 0.85
toNonNegativeIntegerFunction · 0.85

Tested by

no test coverage detected