Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

IsGreaterThan

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

    Example

    class IsGreaterThanDemo {
    @IsGreaterThan(10)
    e:number = 20
    }

    class IsGreaterThanDemo {
    firstNumber:number = 10
    @IsGreaterThan('firstNumber')
    secondNumber:number = 20
    }

    Parameters

    • target: string | number
    • 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 isGreaterThan} 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 isGreaterThan}

Generated using TypeDoc