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

    Function uuidShape

    • Creates a shape that requires a UUID string.

      Parameters

      • defaultValue: `${string}-${string}-${string}-${string}-${string}` = '00000000-0000-1000-0000-000000000000'

      Returns Shape<TUnsafe<`${string}-${string}-${string}-${string}-${string}`>>

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

      const myShape = uuidShape();

      checkValidShape('00000000-0000-1000-0000-000000000000', myShape); // `true`
      checkValidShape('0-0', myShape); // `false`