Compare commits

..

No commits in common. '5a1ece5482caf75b6692134815f925a0ae1201a3' and 'a933fce273b6ff2532db17b53d96d4dc660917dc' have entirely different histories.

@ -54,23 +54,18 @@ module.exports = function hasShape(rules) {
let errors = [];
let newObject = {};
for (let [ key, value ] of Object.entries(object)) {
let rule = rules[key];
for (let [ key, rule ] of Object.entries(rules)) {
let value = object[key];
if (rule != null) {
let { errors: keyErrors, newValue } = applyValidators(value, rule);
let { errors: keyErrors, newValue } = applyValidators(value, rule);
let annotatedErrors = annotateErrors({
pathSegments: [ key ],
errors: keyErrors
});
let annotatedErrors = annotateErrors({
pathSegments: [ key ],
errors: keyErrors
});
errors.push(... annotatedErrors);
newObject[key] = newValue;
} else {
// Extraneous property
newObject[key] = value;
}
errors.push(... annotatedErrors);
newObject[key] = newValue;
}
return validationResult({

@ -6,7 +6,7 @@
"validator",
"combinator"
],
"version": "0.1.3",
"version": "0.1.2",
"main": "index.js",
"repository": "http://git.cryto.net/validatem/has-shape.git",
"author": "Sven Slootweg <admin@cryto.net>",

Loading…
Cancel
Save