Socket
Socket
Sign inDemoInstall

mongoose-paginate-v2

Package Overview
Dependencies
0
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.24 to 1.2.0

6

lib/index.js

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

*/
var deafultOptions = {
var defaultOptions = {
customLabels: {

@@ -56,3 +56,3 @@ totalDocs: 'totalDocs',

function paginate(query, options, callback) {
options = _objectSpread({}, deafultOptions, paginate.options, options);
options = _objectSpread({}, defaultOptions, paginate.options, options);
query = query || {};

@@ -64,3 +64,2 @@ var _options = options,

leanWithId = _options.leanWithId,
limit = _options.limit,
populate = _options.populate,

@@ -70,2 +69,3 @@ projection = _options.projection,

sort = _options.sort;
var limit = parseInt(options.limit, 10) || 0;
var isCallbackSpecified = typeof callback === 'function';

@@ -72,0 +72,0 @@ var findOptions = options.options;

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

@@ -42,4 +42,4 @@ "main": "lib/index.js",

"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.4",
"@babel/cli": "^7.4.3",
"@babel/core": "^7.4.3",
"@babel/plugin-proposal-class-properties": "^7.0.0",

@@ -62,3 +62,2 @@ "@babel/plugin-proposal-decorators": "^7.0.0",

"@babel/preset-env": "^7.3.1",
"babel-cli": "^6.26.0",
"chai": "^4.2.0",

@@ -65,0 +64,0 @@ "mocha": "^6.0.1",

@@ -21,3 +21,3 @@ /**

const deafultOptions = {
const defaultOptions = {
customLabels: {

@@ -44,3 +44,3 @@ totalDocs: 'totalDocs',

options = {
...deafultOptions,
...defaultOptions,
...paginate.options,

@@ -56,3 +56,2 @@ ...options

leanWithId,
limit,
populate,

@@ -63,2 +62,4 @@ projection,

} = options;
const limit = parseInt(options.limit, 10) || 0;

@@ -186,2 +187,2 @@ const isCallbackSpecified = typeof callback === 'function';

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

@@ -75,3 +75,3 @@ 'use strict';

describe('paginates', function () {
/*it('with limit and page', function () {
it('with limit and page', function () {
var query = {

@@ -95,2 +95,3 @@ title: {

console.log(result);
expect(result.docs).to.have.length(0);

@@ -109,3 +110,3 @@ expect(result.totalDocs).to.equal(12);

/*
it('with $where condition', function() {

@@ -161,3 +162,2 @@ var query = {

page: 5,
populate: 'author',
select: {title:1, price:1},

@@ -168,3 +168,3 @@ customLabels: myCustomLabels

return Book.paginate(query, options).then((result) => {
console.log(result);
expect(result.itemsList).to.have.length(10);

@@ -171,0 +171,0 @@ expect(result.itemsList[0].title).to.equal('Book #41');

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc