Skip to main content

Function: dictionary()

Call Signature

dictionary<T>(keyArb, valueArb, constraints?): Arbitrary<Record<string, T>>

Defined in: packages/fast-check/src/arbitrary/dictionary.ts:67

For dictionaries with keys produced by keyArb and values from valueArb

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
keyArbArbitrary<string>Arbitrary used to generate the keys of the object
valueArbArbitrary<T>Arbitrary used to generate the values of the object
constraints?DictionaryConstraints-

Returns

Arbitrary<Record<string, T>>

Remarks

Since 1.0.0

Call Signature

dictionary<K, V>(keyArb, valueArb, constraints?): Arbitrary<Record<K, V>>

Defined in: packages/fast-check/src/arbitrary/dictionary.ts:81

For dictionaries with keys produced by keyArb and values from valueArb

Type Parameters

Type Parameter
K extends PropertyKey
V

Parameters

ParameterTypeDescription
keyArbArbitrary<K>Arbitrary used to generate the keys of the object
valueArbArbitrary<V>Arbitrary used to generate the values of the object
constraints?DictionaryConstraints-

Returns

Arbitrary<Record<K, V>>

Remarks

Since 4.4.0