TextRuleOptions
Defined in: packages/ddd-core/domain/rules/text.rule.ts:7
Options of textRule.
Properties
Section titled “Properties”error?
Section titled “error?”
readonlyoptionalerror?:ValueViolationError
Defined in: packages/ddd-core/domain/rules/text.rule.ts:40
Builds the error thrown for a violation. Defaults to
InvalidValueException.
readonlyfield:string
Defined in: packages/ddd-core/domain/rules/text.rule.ts:9
Field name reported in the violation and in the default message.
maxLength?
Section titled “maxLength?”
readonlyoptionalmaxLength?:number
Defined in: packages/ddd-core/domain/rules/text.rule.ts:25
Most characters after normalization, counted like minLength. A
column limit counted in code points, such as varchar(n), is never
exceeded by a value within it.
minLength?
Section titled “minLength?”
readonlyoptionalminLength?:number
Defined in: packages/ddd-core/domain/rules/text.rule.ts:19
Fewest characters after normalization, counted in UTF-16 code units like
String.length and Zod’s .min().
multiline?
Section titled “multiline?”
readonlyoptionalmultiline?:boolean
Defined in: packages/ddd-core/domain/rules/text.rule.ts:35
true accepts tab, line feed and carriage return inside the text.
Defaults to false: they are a characters violation.
pattern?
Section titled “pattern?”
readonlyoptionalpattern?:RegExp
Defined in: packages/ddd-core/domain/rules/text.rule.ts:30
Pattern the normalized text must match. A g or y flag is rejected,
because test() would then depend on the previous call.
required?
Section titled “required?”
readonlyoptionalrequired?:boolean
Defined in: packages/ddd-core/domain/rules/text.rule.ts:14
false accepts null, undefined and blank text, and normalizes them
to null. Defaults to true: they are a required violation.