Skip to content

Commit c4b29b9

Browse files
authored
chore: correct name in MaxLength validation decorator (#587)
1 parent 15bbdbd commit c4b29b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/decorator/string/MaxLength.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export function maxLength(value: unknown, max: number) {
1616
* Checks if the string's length is not more than given number. Note: this function takes into account surrogate pairs.
1717
* If given value is not a string, then it returns false.
1818
*/
19-
export function MaxLength(min: number, validationOptions?: ValidationOptions): PropertyDecorator {
19+
export function MaxLength(max: number, validationOptions?: ValidationOptions): PropertyDecorator {
2020
return ValidateBy(
2121
{
2222
name: MAX_LENGTH,
23-
constraints: [min],
23+
constraints: [max],
2424
validator: {
2525
validate: (value, args) => maxLength(value, args.constraints[0]),
2626
defaultMessage: buildMessage(

0 commit comments

Comments
 (0)