Documentation

transform()

Transforms the value using the provided callback function.

transform<R>(fn: (value: T) => R): Builder<R>;

Notes

Parameters

Return value

This builder, for chaining; typed using the return type of the transformation function.

Examples

f.string().transform(s => s.trim()).check(s => s.length > 0);
f.number().transform(n => n * 100).positive();

Related