Options
All
  • Public
  • Public/Protected
  • All
Menu

This class to provide basic validation methods

Hierarchy

  • ValidationUtils

Index

Constructors

Properties

securityHelper: SecurityHelper = ...

Methods

  • isJSON(target: any): boolean
  • 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
  • isNumber(value: any): boolean
  • 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
  • isValidURL(value?: string): boolean
  • This method to check if the input is a valid URL

    example
    isValidURL('https://www.example.com');
    

    Parameters

    • Optional value: string

      accepts string

    Returns boolean

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

    example
    • validateEmail('e.g.@i.au')

    Parameters

    • emailAddress: string

      accepts string

    Returns boolean

    • true/false
    • REGEX Explanation: [^\s@]+: Local-part. Allows any character except a space or an @. (Matches e.g.) @: Separator. Mandatory [^\s@]+: Domain. Allows any character except space or an @. (Matches i) \.: Dot. Mandatory literal dot [^\s@]{2,}: TLD (Top-Level Domain). At least two characters, no spaces/at-signs. (Matches au)
  • validateNumberForDirectory(value: string): boolean
  • 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.

  • validateToken(accessToken: string): boolean

Generated using TypeDoc