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

    Function exactShape

    • Creates a shape that requires matching the exact value give.

      Type Parameters

      • const T

      Parameters

      • value: T

      Returns Shape<TUnsafe<T>>

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

      const myShape = exactShape('a');

      checkValidShape('a', myShape); // `true`
      checkValidShape('c', myShape); // `false`

      // normally passing a string to a shape will simplify the shape.
      checkValidShape('c', defineShape('a')); // `true`