Socket
Socket
Sign inDemoInstall

resource-schema

Package Overview
Dependencies
Maintainers
6
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resource-schema - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# 1.2.0
## Bugfixes
- Finders returning duplicate query object keys with non-object values were getting clobbered in some cases
# 1.1.0

@@ -2,0 +7,0 @@ ## Features

23

lib/index.js

@@ -584,5 +584,26 @@ // Generated by CoffeeScript 1.10.0

ResourceSchema.prototype._getMongoQuery = function(requestContext) {
var base, deferred, error1, error2, modelQuery, next, query, queryPromises, req, requestQuery, res, resourceField, resourceQuery, value;
var _objectIsArray, base, deferred, error1, error2, field, modelQuery, next, query, queryPromises, req, requestQuery, res, resourceField, resourceQuery, value;
req = requestContext.req, res = requestContext.res, next = requestContext.next;
requestQuery = req.query;
_objectIsArray = function(obj) {
var i, j, key, len, ref;
ref = _.chain(obj).keys().map(function(key) {
return parseInt(key);
}).sortBy(function(num) {
return num;
}).value();
for (i = j = 0, len = ref.length; j < len; i = ++j) {
key = ref[i];
if (i !== key) {
return false;
}
}
return true;
};
for (field in requestQuery) {
value = requestQuery[field];
if (_.isObject(value) && _objectIsArray(value)) {
requestQuery[field] = _.values(value);
}
}
modelQuery = (typeof (base = this.options).find === "function" ? base.find(requestContext) : void 0) || {};

@@ -589,0 +610,0 @@ queryPromises = [];

2

package.json
{
"name": "resource-schema",
"version": "1.2.0",
"version": "2.0.0",
"description": "Define schemas for RESTful resources from mongoose models, and generate middleware to GET, POST, PUT, and DELETE to those resources.",

@@ -5,0 +5,0 @@ "author": "Good Eggs <open-source@goodeggs.com>",

Sorry, the diff of this file is not supported yet

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