Creates a shape that requires an object with certain keys and values.
Optional
Set to true to allow additional properties in addition to the required properties.
true
false Copy
false
If set to true, all keys are optional.
import {recordShape, checkValidShape} from 'object-shape-tester';const myShape = recordShape({ keys: '', values: -1,});checkValidShape({a: 0}, myShape); // `true`checkValidShape({a: '0'}, myShape); // `false` Copy
import {recordShape, checkValidShape} from 'object-shape-tester';const myShape = recordShape({ keys: '', values: -1,});checkValidShape({a: 0}, myShape); // `true`checkValidShape({a: '0'}, myShape); // `false`
Creates a shape that requires an object with certain keys and values.