MCPcopy Create free account
hub / github.com/code100x/cms / paginationData

Function paginationData

src/lib/utils.ts:238–250  ·  view source on GitHub ↗
(searchParams: QueryParams)

Source from the content-addressed store, hash-verified

236};
237
238export const paginationData = (searchParams: QueryParams) => {
239 const pageNumber = parseInt((searchParams.page || 1).toString(), 10);
240 const pageSize = Math.min(
241 parseInt((searchParams.limit || 30).toString(), 10) || 100,
242 );
243 const skip = (pageNumber - 1) * pageSize;
244
245 return {
246 pageNumber,
247 pageSize,
248 skip,
249 };
250};
251interface PaginationInfo {
252 pageNumber: number;
253 pageSize: number;

Callers 4

PaginationFunction · 0.90
CommentsFunction · 0.90
getQuestionsWithQueryFunction · 0.90
fetchAnswersForQuestionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected