import {defineShape, assertWrapValidShape} from 'object-shape-tester';
const myShape = defineShape({
a: '',
});
assertValidShape({a: 'hi'}, myShape); // returns `{a: 'hi'}`
assertValidShape({a: 'hi', b: 'bye'}, myShape, {allowExtraKeys: true}); // returns `{a: 'hi', b: 'bye'}`
assertValidShape({a: 3, myShape}); // throws an error
ShapeMismatchError If there is a mismatch
Assets that a variable matches the given shape and then returns the variable.