Skip to main content

arbitrary

Callable

  • arbitrary<T>(schema: Pick<Schema<T>, is | schema>): Dependent<T>
  • arbitrary<T>(schema: Node & { infer: T }): Dependent<T>
  • arbitrary<T>(schema: T): Dependent<T[_output]>
  • arbitrary<T>(schema: T): Dependent<Infer<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>