Bunoon: TESS | Manual | Validate

Validation of Javascript objects has never been easier thanks to this section of TESS. You can easily tell if an object is a string, number or boolean, or even a more advanced type, such as an Array or Object, or even a Function. This area is used throughout TESS, so make sure when using other areas that you supply the data it expects, or get the dreaded null error!.

Determines if a value passed is a string or not.

The main arguments for this function are as follows:

  • sString [String] - The value that should be validated.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsTypeString(sValue);

Determines if a value passed is a number or not.

The main arguments for this function are as follows:

  • nNumber [Number] - The value that should be validated.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsTypeNumber(nValue);

Determines if a value passed is a boolean or not.

The main arguments for this function are as follows:

  • bBoolean [Boolean] - The value that should be validated.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsTypeBoolean(bValue);

Determines if a value passed is an object or not.

The main arguments for this function are as follows:

  • oObject [Object] - The value that should be validated.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsTypeObject(oValue);

Determines if a value passed is a function or not.

The main arguments for this function are as follows:

  • oFunction [Object] - The value that should be validated.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsFunction(oValue);

Determines if an object passed is defined or not.

The main arguments for this function are as follows:

  • oObject [Object] - The object that should be checked.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsDefined(oValue);

Determines if an object passed by name is defined or not.

The main arguments for this function are as follows:

  • sName [String] - The name of the object that should be checked.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsNameDefined('sValue');

Determines if an object passed is an array or not.

The main arguments for this function are as follows:

  • aArray [Array] - The object that should be checked.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsArray(aValue);

Determines if an object passed is a date or not.

The main arguments for this function are as follows:

  • oDate [Date] - The object that should be checked.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsDate(oValue);

Determines if an object passed is an object or not.

The main arguments for this function are as follows:

  • oObject [Object] - The object that should be checked.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsObject(oValue);

Determines if a string passed is a URL or not.

The main arguments for this function are as follows:

  • sString [String] - The string that should be checked.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsURL(sValue);

Determines if a string passed is an Email address or not.

The main arguments for this function are as follows:

  • sString [String] - The string that should be checked.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsEmail(sValue);

Determines if a value passed is a float or not.

The main arguments for this function are as follows:

  • nFloat [Number] - The value that should be checked.

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false.

Below is an example of how to use this function:

var bIsValid = $T.Validate.IsFloat(nValue);