<S extends Constraint>(schema: S): LazyArbitrary<S["Type"]>Derives a LazyArbitrary from a schema. The result is memoized so repeated calls with the same schema are cheap.
Details
Prefer toArbitrary when you need the arbitrary directly, or when you
want derivation diagnostics via { report: true }. Unsupported schema
nodes, impossible constraints, invalid candidates, and recursive schemas
without a finite terminal path fail immediately.
export function function toArbitraryLazy<
S extends Constraint
>(schema: S): LazyArbitrary<S["Type"]>
Derives a
LazyArbitrary
from a schema. The result is memoized so
repeated calls with the same schema are cheap.
Details
Prefer
toArbitrary
when you need the arbitrary directly, or when you
want derivation diagnostics via { report: true }. Unsupported schema
nodes, impossible constraints, invalid candidates, and recursive schemas
without a finite terminal path fail immediately.
toArbitraryLazy<function (type parameter) S in toArbitraryLazy<S extends Constraint>(schema: S): LazyArbitrary<S["Type"]>S extends Constraint>(schema: S extends Constraintschema: function (type parameter) S in toArbitraryLazy<S extends Constraint>(schema: S): LazyArbitrary<S["Type"]>S): type LazyArbitrary<T> = (
fc: typeof FastCheck
) => FastCheck.Arbitrary<T>
A thunk that, given the fast-check module, returns an Arbitrary<T>.
Use this type when you need to defer instantiation of the arbitrary, for
example to support recursive schemas.
LazyArbitrary<function (type parameter) S in toArbitraryLazy<S extends Constraint>(schema: S): LazyArbitrary<S["Type"]>S["Type"]> {
const const lawc: LazyArbitraryWithContext<any>lawc = import InternalArbitraryInternalArbitrary.const memoized: (
ast: SchemaAST.AST
) => LazyArbitraryWithContext<any>
memoized(schema: S extends Constraintschema.Constraint["ast"]: SchemaAST.ASTast)
return (fc: typeof FastCheckfc) => const lawc: LazyArbitraryWithContext
;(
fc: typeof FastCheck,
ctx: Annotations.ToArbitrary.Context,
recursionStack?: RecursionStack
) => FastCheck.Arbitrary<any>
lawc(fc: typeof FastCheckfc, {})
}