Skip to main content

arbitrary

Callable

  • arbitrary<T>(schema: Pick<Schema<T>, is | schema>): Dependent<T>
  • arbitrary<T>(schema: Node & { infer: T }): Dependent<T>

  • Create an arbitrary from the compiled Therefore schema.

    Example

    random(arbitrary(HelloWorld))
    // => "hello world"

    Type parameters

    • T = unknown

    Parameters

    • schema: Pick<Schema<T>, is | schema>

      The schema to generate an arbitrary for.

    Returns Dependent<T>