object-shape-tester - v6.3.3
    Preparing search index...

    Function rangeShape

    • Creates a shape that requires a number within the given range. By default, the range is inclusive. See RangeShapeParams for how to change that.

      Type Parameters

      • const T extends number = number

      Parameters

      Returns Shape<TUnsafe<T>>

      import {rangeShape, checkValidShape} from 'object-shape-tester';

      const myShape = rangeShape({min: 1, max: 10});

      checkValidShape(1, myShape); // `true`
      checkValidShape(0, myShape); // `false`