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.1 to 1.3.2

17

lib/index.js

@@ -29,3 +29,3 @@ const bodyParser = require('body-parser');

// used by `mutatePrivateKeys`, looks onto the model for
// used by `removePrivateKeys`, looks onto the model for
// a static with provided key

@@ -48,4 +48,4 @@ if (!this.privatesKey) this.privatesKey = 'privateKeys';

const route = slugify(key);
const url = `${this.path}/${route}/:id?`;
router.use(
const url = `/${route}/:id?`;
router.route(this.path).use(
url,

@@ -57,3 +57,3 @@ bodyParser.json(),

this.mutators,
this.mutatePrivateKeys,
this.removePrivateKeys,
this.endpoint

@@ -83,3 +83,3 @@ );

// mutates query to hide private keys
this.mutatePrivateKeys = function(req, res, next) {
this.removePrivateKeys = function(req, res, next) {
if (!req[this.key].length) return next();

@@ -145,5 +145,4 @@ const keys = Array.isArray(this.model[this.privatesKey])

Rest.prototype.mount = function(app) {
const url = `${this.path}/:id?`;
app.use(
url,
app.route(this.path).use(
'/:id?',
bodyParser.json(),

@@ -154,3 +153,3 @@ this.initializer,

this.mutators,
this.mutatePrivateKeys,
this.removePrivateKeys,
this.endpoint

@@ -157,0 +156,0 @@ );

{
"name": "express-rest-api-generator",
"version": "1.3.1",
"version": "1.3.2",
"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