Creates a shape that requires a number within the given range. By default, the range is inclusive. See RangeShapeParams for how to change that.
import {rangeShape, checkValidShape} from 'object-shape-tester';const myShape = rangeShape({min: 1, max: 10});checkValidShape(1, myShape); // `true`checkValidShape(0, myShape); // `false` Copy
import {rangeShape, checkValidShape} from 'object-shape-tester';const myShape = rangeShape({min: 1, max: 10});checkValidShape(1, myShape); // `true`checkValidShape(0, myShape); // `false`
Creates a shape that requires a number within the given range. By default, the range is inclusive. See RangeShapeParams for how to change that.