UNPKG

@buka/nestjs-type-helper

Version:
16 lines (15 loc) 431 B
import { Pagination } from './pagination'; export class PageRo { items; pagination; static from(items, total, pageQuery) { return { items: items.map((item) => { if (item && typeof item['toObject'] === 'function') return item['toObject'](); return item; }), pagination: Pagination.from(total, pageQuery), }; } }