Update validator: add "isMACAddress" function.

This commit is contained in:
Cyril Schumacher
2015-12-07 18:29:53 +01:00
parent c3ab375b37
commit f67852cbc8
2 changed files with 7 additions and 2 deletions
+2
View File
@@ -19,6 +19,8 @@ validator.isURL("sample");
validator.isFQDN("sample");
validator.isMACAddress("sample");
validator.isIP("sample");
validator.isAlpha("sample");
+5 -2
View File
@@ -22,7 +22,7 @@ interface IEmailoptions {
lowercase?: boolean
}
// callback type for #extend
// callback type for #extend
interface IExtendCallback {
(argv: string): any
}
@@ -54,6 +54,9 @@ interface IValidatorStatic {
// check if the string is a fully qualified domain name (e.g. domain.com).
isFQDN(str: string, options?: IFQDNoptions): boolean;
// check if the string is a MAC address.
isMACAddress(str: string): boolean;
// check if the string is an IP (version 4 or 6).
isIP(str: string, version?: number): boolean;
@@ -177,7 +180,7 @@ interface IValidatorStatic {
// remove characters that do not appear in the whitelist.
whitelist(input: string, chars: string): string;
// remove characters that appear in the blacklist.
// remove characters that appear in the blacklist.
blacklist(input: string, chars: string): string;
// canonicalize an email address.