Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

IsArraySizeLessThan

  • IsArraySizeLessThan(target: number, validationOptions?: ValidationOptions): (object: any, propertyName: string) => void
  • Decorator that checks that the size of the array property is less than the argument.

    Example

     class IsArraySizeLessThanDemo {
    @IsArraySizeLessThan(2)
    p0: any[] = [1]
    }

    Parameters

    • target: number

      The number that the array is being checked against.

    • Optional validationOptions: ValidationOptions

      The validation options

    Returns (object: any, propertyName: string) => void

      • (object: any, propertyName: string): void
      • Parameters

        • object: any
        • propertyName: string

        Returns void

validateValue

  • Value is valid if it passes the {@link isArraySizeLessThan} check.

    Parameters

    • vc: ValidationContext

      The validation context.

    • o: any

      The object containing the property to validate.

    Returns boolean

    True if the array size is less than the constraint

Generated using TypeDoc