object-shape-tester
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -64,3 +64,2 @@ "use strict"; | ||
...options, | ||
ignoreExtraKeys: false, | ||
}); | ||
@@ -150,3 +149,7 @@ Object.assign(keysPassed, newKeysPassed); | ||
if (!matched) { | ||
throw new shape_mismatch_error_1.ShapeMismatchError('no error message'); | ||
const failedKeys = Object.keys(keysPassed).filter((key) => { | ||
return !keysPassed[key]; | ||
}); | ||
const errorMessage = `Failed on key(s): ${failedKeys.join(',')}`; | ||
throw new shape_mismatch_error_1.ShapeMismatchError(errorMessage); | ||
} | ||
@@ -153,0 +156,0 @@ if (!options.ignoreExtraKeys) { |
@@ -59,3 +59,2 @@ import { getObjectTypedKeys, isObject, isRuntimeTypeOf, } from '@augment-vir/common'; | ||
...options, | ||
ignoreExtraKeys: false, | ||
}); | ||
@@ -145,3 +144,7 @@ Object.assign(keysPassed, newKeysPassed); | ||
if (!matched) { | ||
throw new ShapeMismatchError('no error message'); | ||
const failedKeys = Object.keys(keysPassed).filter((key) => { | ||
return !keysPassed[key]; | ||
}); | ||
const errorMessage = `Failed on key(s): ${failedKeys.join(',')}`; | ||
throw new ShapeMismatchError(errorMessage); | ||
} | ||
@@ -148,0 +151,0 @@ if (!options.ignoreExtraKeys) { |
{ | ||
"name": "object-shape-tester", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Test object properties and value types.", | ||
@@ -42,2 +42,3 @@ "keywords": [], | ||
"devDependencies": { | ||
"@augment-vir/browser": "^16.2.0", | ||
"@augment-vir/browser-testing": "^16.2.0", | ||
@@ -44,0 +45,0 @@ "@augment-vir/node-js": "^16.2.0", |
53538
898
29