File size: 280 Bytes
484fdbc
 
 
2703d15
 
484fdbc
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import { Request } from "express";

export const parsePaginationQuery = (query: Request["query"]) => {
  const limit = query.limit && parseInt(query.limit as string) || 10;
  const skip = query.skip && parseInt(query.skip as string) || 0;

  return {
    limit,
    skip,
  };
};