@aequum/typeorm
Version:
aequum TypeORM tools for repository, pagination, CRUD/CRUDL, configs and utils
22 lines (21 loc) • 632 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultTypeORMPaginatorOptions = void 0;
/**
* Default options for TypeORM paginator, notice we only change the
* `metaTransformer` to match the `PaginateResultPaginator`, also an
* useless `limit` and `page` are set to 0, this is because are mandatory
*
*/
exports.DefaultTypeORMPaginatorOptions = {
metaTransformer: (meta) => ({
page: 0,
size: meta.itemsPerPage || 0,
pages: meta.totalPages || 0,
next: null,
prev: null,
total: meta.totalItems || 0,
}),
limit: 0,
page: 0,
};