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

    Function tupleShape

    • Creates a shape that requires a tuple.

      Type Parameters

      • T extends any[]

      Parameters

      • ...tupleParts: T

      Returns Shape<
          TTuple<
              {
                  [Index in string
                  | number
                  | symbol]: ShapeInitSchema<T[Index<Index>]>
              },
          >,
      >

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

      const myShape = tupleShape('', -1);

      checkValidShape(
      [
      'a',
      10,
      ],
      myShape,
      ); // `true`
      checkValidShape(
      [
      'a',
      ],
      myShape,
      ); // `false`