Skip to content

primitive

Call Signature

primitive(context): Dependent<Primitive>

It returns an arbitrary that generates primitives.

Example

random(primitive())
// => null
random(primitive())
// => Symbol(4EM)

Parameters

context

MaybePartial<PrimitiveGenerator> & object

Returns

Dependent<Primitive>

A primitive arbitrary.

Call Signature

primitive(context?): Dependent<Maybe<Primitive>>

It returns an arbitrary that generates primitives.

Example

random(primitive())
// => null
random(primitive())
// => Symbol(4EM)

Parameters

context?

MaybePartial<PrimitiveGenerator>

Returns

Dependent<Maybe<Primitive>>

A primitive arbitrary.