returnnewValidationError(`Encountered an unexpected property '${propertyName}'`);
returnnewValidationError(`Encountered an unexpected property '${propertyName}'`);
}else{
}else{
@ -58,8 +58,8 @@ module.exports = function hasShape(rules) {
// We need to consider the keys from the ruleset (for detecting missing required properties) *and* the keys from the actual object (for handling extraneous values).
// We need to consider the keys from the ruleset (for detecting missing required properties) *and* the keys from the actual object (for handling extraneous values).
letallKeys=arrayUnion(
letallKeys=arrayUnion(
Object.keys(rules),
Reflect.ownKeys(rules),
Object.keys(object)
Reflect.ownKeys(object)
);
);
for(letkeyofallKeys){
for(letkeyofallKeys){
@ -82,6 +82,7 @@ module.exports = function hasShape(rules) {
}
}
}else{
}else{
// Extraneous property
// Extraneous property
// FIXME: Assign non-enumerable if the source property was non-enumerable!