StructureJS
0.14.7A 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.
A ValidationUtility class that has several static methods to assist in development.
isEmpty
value
Determines if the String passed has a length.
value
String
ValidationUtil.isEmpty('sometext');
// false
isMatch
value1
value2
Determines if the two values passed in are the same.
value1
Any
value2
Any
ValidationUtil.isMatch('one@email.com', 'two@email.com');
// false
isPostalCode
postalCode
Determines if the String passed in is a postal code.
postalCode
String
ValidationUtil.isPostalCode('p8n3h3');
// true
isSocialSecurityNumber
ssn
Determines if the String passed in is a Social Security Number.
ssn
String
ValidationUtil.isSocialSecurityNumber('178051120');
// true
isValidEmailAddress
email
Determines if the String passed in is a valid email address.
email
String
ValidationUtil.isValidEmailAddress('someemail@address.com');
// true
isValidPhoneNumber
phoneNumber
Determines if the String passed in is a phone number.
phoneNumber
String
ValidationUtil.isValidPhoneNumber('123 456 7899');
// true
isZipCode
zipCode
Determines if the String passed in is a zip code.
zipCode
String
ValidationUtil.isZipCode('55067 4434');
// true