Socket
Socket
Sign inDemoInstall

@baapcompany/core-api

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@baapcompany/core-api - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "@baapcompany/core-api",
"version": "1.0.2",
"version": "1.0.3",
"description": "To make it easy for you to get started with GitLab, here's a list of recommended next steps.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -129,2 +129,28 @@ const ServiceResponse = require("@baapcompany/core-api/services/serviceResponse");

async preparePaginationAndReturnData(query, criteria) {
const pagination = {
pageNumber : criteria.pageNumber,
pageSize : criteria.pageSize
}
const paginationErrors =
this.validateAndSanitizePaginationProps(pagination);
if (paginationErrors) {
return paginationErrors;
}
return this.execute(async () => {
return {
items: await this.model.find(
query,
{},
{
skip: pagination.pageSize * (pagination.pageNumber - 1),
limit: pagination.pageSize,
}
),
totalItemsCount: await this.model.countDocuments(query),
};
});
}
async paginationResults(query, pagination) {

@@ -131,0 +157,0 @@ return this.execute(async () => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc