Comparing version 0.8.1 to 0.8.2
@@ -34,2 +34,8 @@ ## [Unreleased] | ||
## [0.8.2] - 2018-01-22 | ||
### Fixed | ||
* Bugs in validation Schema field names (Document payload) | ||
## [0.8.1] - 2018-01-12 | ||
@@ -378,2 +384,3 @@ | ||
[0.8.2]: https://github.com/Yonirt/moltyjs/compare/v0.8.1...v0.8.2 | ||
[0.8.1]: https://github.com/Yonirt/moltyjs/compare/v0.8.0...v0.8.1 | ||
@@ -380,0 +387,0 @@ [0.8.0]: https://github.com/Yonirt/moltyjs/compare/v0.7.0...v0.8.0 |
@@ -204,3 +204,3 @@ 'use strict'; | ||
// Array | ||
if (!schema[key].type && isArray(schema[key])) { | ||
if (isArray(schema[key]) && !schema[key][0].type && payload[key]) { | ||
payload[key].forEach(arrayItem => { | ||
@@ -212,3 +212,3 @@ return this._validatePayloadFieldNames(arrayItem, schema[key][0]); | ||
// Objects nested | ||
if (!schema[key].type && isObject(schema[key]) && !isArray(schema[key])) { | ||
if (isObject(schema[key]) && !isArray(schema[key]) && !schema[key].type && isObject(payload[key]) && Object.keys(payload[key]).length > 0) { | ||
return this._validatePayloadFieldNames(payload[key], schema[key]); | ||
@@ -215,0 +215,0 @@ } |
{ | ||
"name": "moltyjs", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "A tiny ODM for MongoDB with multy tenancy support.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
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
117362