generateStringValidation()
generateStringValidation(
varName,ctx,constraints?,customTypeMessage?):object
Experimental
Generates complete validation code for a string schema with all constraints.
Parametersβ
varName: stringβ
The variable name to validate.
ctx: GeneratorContextβ
The generator context.
constraints?: StringConstraintMetaβ
Optional string constraint metadata.
customTypeMessage?: stringβ
Optional custom type error message.
Returns: objectβ
Generated code lines and updated context.
code: string[]β
ctx: GeneratorContextβ
Sinceβ
2.0.0