import {defineShape, assertValidShape} from 'object-shape-tester';
const myShape = defineShape({
a: '',
});
assertValidShape({a: 'hi'}, myShape); // succeeds
assertValidShape({a: 'hi', b: 'bye'}, myShape, {allowExtraKeys: true}); // succeeds
assertValidShape({a: 3, myShape}); // fails
ShapeMismatchError If there is a mismatch
Assets that a variable matches the given shape.