New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

baucis

Package Overview
Dependencies
Maintainers
1
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baucis - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

1

index.js

@@ -40,2 +40,3 @@ // Dependencies

controller.set('plural', options.plural || lingo.en.pluralize(options.singular));
controller.set('findBy', options.findBy || '_id');

@@ -42,0 +43,0 @@ controller.set('basePath', basePath);

@@ -0,1 +1,11 @@

// Private Members
// ---------------
function getFindCondition (request) {
var conditions = {};
conditions[request.app.get('findBy')] = request.params.id;
return conditions;
}
// Module Definition
// -----------------
var middleware = module.exports = {

@@ -5,3 +15,3 @@ // Retrieve header for the addressed document

var Model = request.app.get('model');
request.baucis.query = Model.findById(request.params.id);
request.baucis.query = Model.findOne(getFindCondition(request));
next();

@@ -18,3 +28,3 @@ },

var Model = request.app.get('model');
request.baucis.query = Model.findById(request.params.id);
request.baucis.query = Model.findOne(getFindCondition(request));
next();

@@ -101,3 +111,7 @@ },

request.baucis.query = Model.findByIdAndUpdate(id, request.body, { upsert: true });
request.baucis.query = Model.findOneAndUpdate(
getFindCondition(request, id),
request.body,
{ upsert: true }
);
next();

@@ -112,3 +126,3 @@ },

var Model = request.app.get('model');
request.baucis.query = Model.remove({ _id: request.params.id });
request.baucis.query = Model.remove(getFindCondition(request));
next();

@@ -115,0 +129,0 @@ },

2

package.json
{
"name": "baucis",
"version": "0.4.1",
"version": "0.4.2",
"main": "index.js",

@@ -5,0 +5,0 @@ "scripts": {

@@ -1,3 +0,3 @@

baucis v0.4.1
===============
baucis v0.4.2
=============

@@ -4,0 +4,0 @@ Baucis is Express middleware that creates configurable REST APIs using Mongoose schemata.

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