StructureJS

0.15.2

A class based utility library for building modular and scalable web platform applications. Features opt-in classes and utilities which provide a solid foundation and toolset to build your next project.

ValidationUtil Class

Module: util
Parent Module: StructureJS

A ValidationUtility class that has several static methods to assist in development.

Index

Show:

Methods

Methods

isEmpty
(
  • value
)
Boolean public static

Determines if the String passed has a length.

Parameters:

Returns:

Example:

 ValidationUtil.isEmpty('sometext');
 // false

isMatch
(
  • value1
  • value2
)
Boolean public static

Determines if the two values passed in are the same.

Parameters:

  • value1 Any
  • value2 Any

Returns:

Example:

 ValidationUtil.isMatch('one@email.com', 'two@email.com');
 // false

isPostalCode
(
  • postalCode
)
Boolean public static

Determines if the String passed in is a postal code.

Parameters:

Returns:

Example:

 ValidationUtil.isPostalCode('p8n3h3');
 // true

isSocialSecurityNumber
(
  • ssn
)
Boolean public static

Determines if the String passed in is a Social Security Number.

Parameters:

Returns:

Example:

 ValidationUtil.isSocialSecurityNumber('178051120');
 // true

isValidEmailAddress
(
  • email
)
Boolean public static

Determines if the String passed in is a valid email address.

Parameters:

Returns:

Example:

 ValidationUtil.isValidEmailAddress('someemail@address.com');
 // true

isValidPhoneNumber
(
  • phoneNumber
)
Boolean public static

Determines if the String passed in is a phone number.

Parameters:

Returns:

Example:

 ValidationUtil.isValidPhoneNumber('123 456 7899');
 // true

isZipCode
(
  • zipCode
)
Boolean public static

Determines if the String passed in is a zip code.

Parameters:

Returns:

Example:

 ValidationUtil.isZipCode('55067 4434');
 // true

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index