Skip to main content

Function: jsonValue()

jsonValue(constraints?): Arbitrary<JsonValue>

Defined in: packages/fast-check/src/arbitrary/jsonValue.ts:22

For any JSON compliant values

Keys and string values rely on string

As JSON.parse preserves -0, jsonValue can also have -0 as a value. jsonValue must be seen as: any value that could have been built by doing a JSON.parse on a given string.

Parameters

ParameterTypeDescription
constraintsJsonSharedConstraintsConstraints to be applied onto the generated instance

Returns

Arbitrary<JsonValue>

Remarks

Since 2.20.0