Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mongoose-paginate-v2

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-paginate-v2 - npm Package Compare versions

Comparing version 1.3.7 to 1.3.8

2

dist/index.js

@@ -185,3 +185,3 @@ "use strict";

meta[labelPrevPage] = page - 1;
} else if (page == 1 && offset !== 0) {
} else if (page == 1 && offset && offset !== 0) {
meta[labelHasPrevPage] = true;

@@ -188,0 +188,0 @@ meta[labelPrevPage] = 1;

{
"name": "mongoose-paginate-v2",
"version": "1.3.7",
"version": "1.3.8",
"description": "A cursor based custom pagination library for Mongoose with customizable labels.",

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

@@ -188,3 +188,3 @@ /**

meta[labelPrevPage] = (page - 1);
} else if (page == 1 && offset !== 0) {
} else if (page == 1 && offset && offset !== 0) {
meta[labelHasPrevPage] = true;

@@ -245,2 +245,2 @@ meta[labelPrevPage] = 1;

module.exports.paginate = paginate;
module.exports.paginate = paginate;

@@ -116,3 +116,31 @@ 'use strict';

});
it('first page with page and limit', function() {
var query = {
title: {
$in: [/Book/i],
},
};
var options = {
limit: 10,
page: 1,
lean: true,
};
return Book.paginate(query, options).then(result => {
expect(result.docs).to.have.length(10);
expect(result.totalDocs).to.equal(100);
expect(result.limit).to.equal(10);
expect(result.page).to.equal(1);
expect(result.pagingCounter).to.equal(1);
expect(result.hasPrevPage).to.equal(false);
expect(result.hasNextPage).to.equal(true);
expect(result.prevPage).to.equal(null);
expect(result.nextPage).to.equal(2);
expect(result.totalPages).to.equal(10);
});
});
it('with offset and limit (not page)', function () {

@@ -431,2 +459,2 @@ var query = {

});
});
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