resource-schema
Advanced tools
Comparing version 1.2.0 to 2.0.0
@@ -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 |
@@ -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 = []; |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1326
99000
12
1