Options
All
  • Public
  • Public/Protected
  • All
Menu

This class to provide basic validation methods

Hierarchy

  • ValidationUtils

Index

Constructors

Methods

  • isJSON(target: any): boolean
  • This method to check whether object is valid JSON or not

    example
    • isJSON(sampleObject);

    Parameters

    • target: any

    Returns boolean

    • true/false
  • isNotNullOrEmpty(value: any): boolean
  • This method to check value is not null or empty

    example
    isNotNullOrEmpty('data');
    

    Parameters

    • value: any

      any type of value

    Returns boolean

    • true/false
  • isNotNullOrEmptyArray(value: any): boolean
  • This method to check value is array is empty or not

    example
    isNotNullOrEmptyArray(['abc','xyz']);
    

    Parameters

    • value: any

      any type of value

    Returns boolean

    • true/false
  • isNotNullOrUndefined(value: any): boolean
  • This method to check value is not null or undefined

    example
    isNotNullOrUndefined('data');
    

    Parameters

    • value: any

      any type of value

    Returns boolean

    • true/false
  • isNullOrEmpty(value: any): boolean
  • This method to check null or empty value

    example
    • isNullOrEmpty('');

    Parameters

    • value: any

      any type of value

    Returns boolean

    • true/false
  • isNumber(value: any): boolean
  • This method to check value is number or not

    example
    isNumber(3);
    

    Parameters

    • value: any

      any type of value

    Returns boolean

    • true/false
  • isValidObject(value: any): boolean
  • This method to check whether object is valid or not

    example
    • isValidObject(sampleObject);

    Parameters

    • value: any

      any type of value

    Returns boolean

    • true/false
  • validateEmail(value: string): boolean
  • Checks the value is valid email address or not

    example
    validateEmail(test@test.com);
    

    Parameters

    • value: string

      accepts string

    Returns boolean

    • true/false
  • validateNumberForDirectory(value: string): boolean
  • Checks the value is number or not for Directory search

    example
    validateNumber(77);
    

    Parameters

    • value: string

      accepts string

    Returns boolean

    • true/false
  • validateRFCSupportedEmail(value: string): boolean
  • Validates whether the provided email address conforms to a basic RFC-compliant format.

    The email address must have the following characteristics:

    • A local part (before the @ symbol) that does not contain whitespace or the @ symbol.
    • A domain part (after the @ symbol) that:
      • Starts with an alphanumeric character.
      • May contain alphanumeric characters, dots (.), and hyphens (-) in the middle.
      • Does not start or end with a special character.
    • A top-level domain (after the last .) that consists of at least two alphabetic characters.
    example

    validateRFCSupportedEmail(rishav.kumar@nice.com);

    Parameters

    • value: string

      The email address to validate.

    Returns boolean

    boolean - true if the email address is valid according to the specified criteria; otherwise, false.

Generated using TypeDoc