Options
All
  • Public
  • Public/Protected
  • All
Menu

Module decorators/IsArraySizeGreaterThan

Index

Functions

IsArraySizeGreaterThan

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

    Example

     class IsArraySizeGreaterThanDemo {
    @IsArraySizeGreaterThan(2)
    p0: any[] = [1,2,3]
    }

    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 isArraySizeGreaterThan} check.

    Parameters

    • vc: ValidationContext

      The validation context.

    • o: any

      The object containing the property to validate.

    Returns boolean

    The result of the call to {@link isArraySizeGreaterThan}

Generated using TypeDoc