refactor imports/exports

This commit is contained in:
andres
2023-07-16 16:21:55 +02:00
parent 2f1579ed48
commit 4a9bf1e858
26 changed files with 50 additions and 40 deletions

View File

@@ -1,4 +1,5 @@
import { isObject } from 'remeda'
import { DEFAULT_PAGE_NUMBER, DEFAULT_PAGE_SIZE } from './pagination.constants'
export class Pagination {
static getPaginationData<T>(query: T) {
@@ -9,13 +10,13 @@ export class Pagination {
typeof query.currentPage === 'string' &&
!isNaN(Number(query.currentPage))
? +query.currentPage
: 1
: DEFAULT_PAGE_NUMBER
const itemsPerPage =
'itemsPerPage' in query &&
typeof query.itemsPerPage === 'string' &&
!isNaN(Number(query.itemsPerPage))
? +query.itemsPerPage
: 10
: DEFAULT_PAGE_SIZE
return { currentPage, itemsPerPage, ...query }
}

View File

@@ -0,0 +1,3 @@
export * from './cookie.decorator'
export * from './is-optional-or-empty-string.decorator'
export * from './is-order-by-constraint.decorator'