Class: Value<T>
Defined in: packages/fast-check/src/check/arbitrary/definition/Value.ts:13
A Value<T, TShrink = T> holds an internal value of type T
and its associated context
Remarks
Since 3.0.0 (previously called NextValue in 2.15.0)
Type Parameters
| Type Parameter |
|---|
T |
Constructors
Constructor
new Value<
T>(value_,context,customGetValue?):Value<T>
Defined in: packages/fast-check/src/check/arbitrary/definition/Value.ts:50
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
value_ | T | undefined | Internal value of the shrinkable |
context | unknown | undefined | Context associated to the generated value (useful for shrink) |
customGetValue | (() => T) | undefined | undefined | Limited to internal usages (to ease migration to next), it will be removed on next major |
Returns
Value<T>
Properties
context
readonlycontext:unknown
Defined in: packages/fast-check/src/check/arbitrary/definition/Value.ts:43
Context for the generated value TODO - Do we want to clone it too?
Remarks
2.15.0
hasToBeCloned
readonlyhasToBeCloned:boolean
Defined in: packages/fast-check/src/check/arbitrary/definition/Value.ts:19
State storing the result of hasCloneMethod
If true the value will be cloned each time it gets accessed
Remarks
Since 2.15.0
value
readonlyvalue:T
Defined in: packages/fast-check/src/check/arbitrary/definition/Value.ts:32
Safe value of the shrinkable
Depending on hasToBeCloned it will either be value_ or a clone of it
Remarks
Since 2.15.0
value_
readonlyvalue_:T
Defined in: packages/fast-check/src/check/arbitrary/definition/Value.ts:37
Internal value of the shrinkable
Remarks
Since 2.15.0