Skip to content

Commit

Permalink
chore: correct name in MaxLength validation decorator (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
jengel3 authored Apr 23, 2020
1 parent 15bbdbd commit c4b29b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/decorator/string/MaxLength.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export function maxLength(value: unknown, max: number) {
* Checks if the string's length is not more than given number. Note: this function takes into account surrogate pairs.
* If given value is not a string, then it returns false.
*/
export function MaxLength(min: number, validationOptions?: ValidationOptions): PropertyDecorator {
export function MaxLength(max: number, validationOptions?: ValidationOptions): PropertyDecorator {
return ValidateBy(
{
name: MAX_LENGTH,
constraints: [min],
constraints: [max],
validator: {
validate: (value, args) => maxLength(value, args.constraints[0]),
defaultMessage: buildMessage(
Expand Down

0 comments on commit c4b29b9

Please sign in to comment.