File size: 268 Bytes
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.take && parseInt(query.limit as string);
  const skip = query.skip && parseInt(query.skip as string);

  return {
    limit,
    skip,
  };
};