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

restful-goose

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restful-goose - npm Package Compare versions

Comparing version 1.3.5 to 1.3.6-a

2

lib/query-search.js

@@ -11,3 +11,3 @@ var async = require('async');

_.forOwn(obj, function(value, key) {
obj[key] = (Model.schema.paths[key].options.type.schemaName === 'String' || Model.schema.paths[key].options.type === String) ? { $regex: value, $options: 'i' } : value;
obj[key] = (Model.schema.paths[key] && (Model.schema.paths[key].options.type.schemaName === 'String' || Model.schema.paths[key].options.type === String)) ? { $regex: value, $options: 'i' } : value;
});

@@ -14,0 +14,0 @@

@@ -139,6 +139,13 @@ var express = require('express');

Model.findById(req.params.parent, function(err, parentDoc) {
if (!parentDoc) {
return res.__onError(req, res, { name: 'NotFound' });
}
req.parent = parentDoc;
req.parentPath = _.find(SubModel.schema.paths, function(p) {
var parentPath = _.find(SubModel.schema.paths, function(p) {
return p.options.ref === Model.modelName;
}).path;
});
if (!parentPath) {
return res.__onError(req, res, { name: 'BadRequest' });
}
req.parentPath = parentPath.path;
req.baseURL = replaceSlashes(req.baseURL + '/' + parentDoc.id + '/relationships/' + subResource);

@@ -145,0 +152,0 @@ next();

@@ -36,7 +36,5 @@ var express = require('express');

if (req.parent && req.parentPath) {
console.log('hasParent');
if (!req.query) {
req.query = {};
}
console.log('parentPath: ' + req.parentPath);
req.query[req.parentPath] = req.parent._id;

@@ -71,2 +69,10 @@ }

var attributes;
if (typeof obj === 'string') {
try {
obj = JSON.parse(obj);
} catch(e) {
return res.__onError(req, res, { name: 'BadRequest' });
}
}

@@ -73,0 +79,0 @@ if (!obj || obj.hasOwnProperty('attributes') === false) {

{
"name": "restful-goose",
"version": "1.3.5",
"version": "1.3.6a",
"description": "Yet another RESTful microservice generator for Mongoose with an emphasis on flexibility",

@@ -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