Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

IsDivisibleBy

  • IsDivisibleBy(target: number, validationOptions?: ValidationOptions): (object: any, propertyName: string) => void
  • Decorator that checks if the property is divisible by the argument.

    Example

    class IsDivisibleByDemo {
    @IsDivisibleBy(2)
    d:number = 10
    }

    Parameters

    • target: number

      The number that the value should be divisible by.

    • Optional validationOptions: ValidationOptions

      The validation options

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

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

        • object: any
        • propertyName: string

        Returns void

validateArray

validateValue

  • Value is valid if it passes the {@link isDivisibleBy} 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 isDivisibleBy}

Generated using TypeDoc