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

    Function classShape

    • Creates a shape for a specific class. Value checks are done through instanceof.

      Type Parameters

      Parameters

      • classConstructor: T
      • OptionaldefaultValue: InstanceType<T>

      Returns Shape<TUnsafe<InstanceType<T>>>

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

      const myShape = classShape(RegExp);

      checkValidShape(/hi/, myShape); // `true`
      checkValidShape('hi', myShape); // `false`