Aller au contenu principal

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