object-shape-tester - v5.1.6
    Preparing search index...

    Function exact

    • Define a shape part that requires exactly the value given.

      Type Parameters

      • const Parts extends readonly [unknown, unknown]

      Parameters

      Returns ShapeExact<Parts>

      import {exact, defineShape} from 'object-shape-tester';

      const myShape = defineShape({
      a: or(exact('hi'), exact('bye')),
      });

      // `myShape.runtimeType` is `{a: 'hi' | 'bye'}`