simpl-schema
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -6,2 +6,4 @@ <!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
- [simpl-schema CHANGELOG](#simpl-schema-changelog) | ||
- [1.1.2](#112) | ||
- [1.1.1](#111) | ||
- [1.1.0](#110) | ||
@@ -28,2 +30,6 @@ - [1.0.0](#100) | ||
## 1.1.2 | ||
Passing a definition with no `type` to `extend` now works as expected, as long as the existing definition already has a `type`. | ||
## 1.1.1 | ||
@@ -30,0 +36,0 @@ |
@@ -519,4 +519,3 @@ 'use strict'; | ||
Object.keys(schemaObj).forEach(function (fieldName) { | ||
var definition = (0, _clone2.default)(schemaObj[fieldName]); | ||
standardizeDefinition(definition); | ||
var definition = standardizeDefinition(schemaObj[fieldName]); | ||
@@ -1035,4 +1034,8 @@ // Merge/extend with any existing definition | ||
function standardizeDefinition(def) { | ||
// Internally, all definition types are stored as groups for simplicity of access | ||
if (def.type && !(def.type instanceof _SimpleSchemaGroup2.default)) { | ||
def = (0, _clone2.default)(def); | ||
// Internally, all definition types are stored as groups for simplicity of access. | ||
// If we are extending, there may not actually be def.type, but it's okay because | ||
// it will be added later when the two SimpleSchemaGroups are merged. | ||
if (!def.type || !(def.type instanceof _SimpleSchemaGroup2.default)) { | ||
def.type = new _SimpleSchemaGroup2.default((0, _lodash8.default)(def, oneOfProps)); | ||
@@ -1044,2 +1047,4 @@ } | ||
}); | ||
return def; | ||
} | ||
@@ -1046,0 +1051,0 @@ |
{ | ||
"name": "simpl-schema", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A schema validation package that supports direct validation of MongoDB update modifier objects.", | ||
@@ -5,0 +5,0 @@ "author": "Eric Dobbertin <aldeed@gmail.com>", |
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
172664
2572