UFValidators defines various static methods to validate values.

There are two form of validation methods:

  • the isXXXX(*) methods perform an immediate validation of a value.
  • the createXXXX methods create and return a validation function to validate a value.

Methods

  • Creates a validator that checks if a value is a valid integer and within a certain value range.

    Parameters

    • aMin: number

      Minimum value allowed (including this value)

    • Optional aMax: number = Number.MAX_VALUE

      Maximum value allowed (including this value)

    Returns IUFValidateValue

    validator function.

  • Creates a validator that checks if a value is a valid integer and within a certain value range.

    Parameters

    • aMin: number

      Minimum value allowed (including this value)

    • Optional aMax: number = Number.MAX_VALUE

      Maximum value allowed (including this value)

    Returns IUFValidateValue

    validator function.

  • Creates a validator that checks if a value is a valid number and within a certain value range.

    Parameters

    • aMin: number

      Minimum value allowed (including this value)

    • Optional aMax: number = Number.MAX_VALUE

      Maximum value allowed (including this value)

    Returns IUFValidateValue

    validator function.

  • Creates a validator function that checks if a value is string with a certain length.

    Parameters

    • aMin: number

      Minimal number of characters allowed

    • Optional aMax: number = Number.MAX_VALUE

      Maximum number of characters allowed

    Returns IUFValidateValue

    validator function.

  • Creates a validator that checks if a property contains a valid value. The validator does not do anything with the passed value.

    Parameters

    • aProperty: string

      Property name

    • aData: IUFModel

      Data instance

    Returns IUFValidateValue

    validator function.

  • Checks if a value is an array.

    Parameters

    • aValue: any

      Value to test

    Returns boolean

    true if aValue is a valid city name.

  • Checks if a value is a valid city name.

    Parameters

    • aValue: any

      Value to test

    Returns boolean

    true if aValue is a valid city name.

  • Checks if a value is a valid email address.

    Parameters

    • aValue: any

      Value to test

    Returns boolean

    true if aValue is a valid email address.

  • Checks if a value is a valid integer.

    Parameters

    • aValue: any

      Value to test

    Returns boolean

    true if aValue is a valid integer.

  • Checks if a text contains at least one non space character.

    Parameters

    • aValue: any

      Value to validate

    Returns boolean

    True if the value contains one or more non-space chars; false if the string is null, empty or contains only spaces.

  • Checks if a value is valid number.

    Parameters

    • aValue: any

      Value to test

    Returns boolean

    the result of !isNaN(aValue)

  • Checks if a property has a valid value.

    Parameters

    Returns boolean

    result from validator or true if validator is not supported.

  • Checks if a value is a valid dutch zip code.

    Parameters

    • aValue: any

      Value to test

    Returns boolean

    true if aValue is a valid dutch zip code.