We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15bbdbd commit c4b29b9Copy full SHA for c4b29b9
src/decorator/string/MaxLength.ts
@@ -16,11 +16,11 @@ export function maxLength(value: unknown, max: number) {
16
* Checks if the string's length is not more than given number. Note: this function takes into account surrogate pairs.
17
* If given value is not a string, then it returns false.
18
*/
19
-export function MaxLength(min: number, validationOptions?: ValidationOptions): PropertyDecorator {
+export function MaxLength(max: number, validationOptions?: ValidationOptions): PropertyDecorator {
20
return ValidateBy(
21
{
22
name: MAX_LENGTH,
23
- constraints: [min],
+ constraints: [max],
24
validator: {
25
validate: (value, args) => maxLength(value, args.constraints[0]),
26
defaultMessage: buildMessage(
0 commit comments