Primitives
Strings, numbers, and booleans are the atoms of every forged object — and can be forged on their own.
String
By default the charset mixes lowercase, uppercase, digits, and special characters; the length is 10. Both are tunable:
Full option list: String settings.
Number
Ranges and fractional output are controlled by number settings:
If numberMin exceeds numberMax, Forger fixes the range instead of throwing — the maximum becomes numberMin + 100. Details in Number settings.
Boolean
Booleans ignore settings.
null and undefined
Standalone null and undefined type arguments forge to null — there is no meaningful random value for them:
Inside unions they behave differently: null | number and number | undefined both produce a number, because nullable members are dropped during generation (see Unions).
Assertions on primitives
Generated values are random — assert on type and constraints, not on concrete values:
When a concrete primitive is required, generate it first and reuse the generated value as the expected constant: