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

express-rest-api-generator

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-rest-api-generator - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

readme.md

13

lib/index.js
const bodyParser = require('body-parser');
const log = require('debug')('bot:app:rest:'); // eslint-disable-line
const log = require('debug')('rest:'); // eslint-disable-line
const { slugify, toNum, omit } = require('./helpers');

@@ -164,12 +164,13 @@

let { limit = this.pageSizeDefault, page = 0 } = query;
const { sort = this.sortBy } = query;
const { sort = this.sortBy, populate = null } = query;
limit = Math.min(this.pageSizeMax, toNum(limit));
page = toNum(page);
const search = id ? { _id: id } : {};
return this.model
.find(Object.assign(search, omit(query, ['page', 'limit', 'sort'])))
const queryWrapper = this.model
.find(Object.assign(search, omit(query, ['page', 'limit', 'sort', 'populate'])))
.sort(sort)
.limit(limit)
.skip(page > 0 ? (page - 1) * limit : 0)
.execAsync()
.skip(page > 0 ? (page - 1) * limit : 0);
if (populate) queryWrapper.populate(populate);
return queryWrapper.execAsync()
.catch(fn)

@@ -176,0 +177,0 @@ .then(fn.bind(null, null));

{
"name": "express-rest-api-generator",
"version": "1.3.3",
"version": "1.3.4",
"description": "express mountable app for mongoose routes with generators for mongoose model embedded statics",

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

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