Aller au contenu principal

generateStartsWithCheck()

generateStartsWithCheck(varName, prefix, ctx, customMessage?): CodeGenResult

Experimental

Generates inline code for the startsWith constraint.


Parameters

varName: string

The variable name to check.

prefix: string

The required prefix.

ctx: GeneratorContext

The generator context.

customMessage?: string

Optional custom error message.


Returns: CodeGenResult

Generated code and updated context.


Since

2.0.0