Generates JavaScript for form field validation and error checking.
Shared by both ColocatedTransformer (compile-time) and JsGenerator (runtime).
Handles constraint-based validation (required, min_length, max, match, etc.)
and custom error checks from extend_errors.
Summary
Functions
Generate JS for a combined form errors derive (concatenates all field error arrays).
Generate JS for a combined form validation derive (ANDs all field validations).
Generate JS for a field errors derive (returns array of error strings).
Generate JS for a field validation derive (returns boolean).
Functions
Generate JS for a combined form errors derive (concatenates all field error arrays).
Generate JS for a combined form validation derive (ANDs all field validations).
Generate JS for a field errors derive (returns array of error strings).
Options:
name- derive name (e.g.,:checkout_name_errors)params_field- the params state fieldvalidation- validation speccustom_errors- list of custom error specs fromextend_errorsash_validations- Ash validation specs with custom messagesskip_constraints- whether to skip constraint checksopts- keyword list::expand_defrx- function to expand defrx in source strings (optional):server_errors_field- field name for server errors merge (optional)
Generate JS for a field validation derive (returns boolean).
Options:
name- derive name (e.g.,:checkout_name_valid)params_field- the params state field (e.g.,:checkout_params)validation- validation spec fromConstraintTranspilerskip_constraints- whether to skip all constraint checks