mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
validator (v9.4): add options for isMobilePhone()
This commit is contained in:
Vendored
+7
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for validator.js v9.3
|
||||
// Type definitions for validator.js v9.4
|
||||
// Project: https://github.com/chriso/validator.js
|
||||
// Definitions by: tgfjt <https://github.com/tgfjt>
|
||||
// Ilya Mochalov <https://github.com/chrootsu>
|
||||
@@ -163,7 +163,7 @@ declare namespace ValidatorJS {
|
||||
// 'fi-FI', 'fo-FO', 'fr-FR', 'he-IL', 'hu-HU', 'id-ID', 'it-IT', 'ja-JP', 'kk-KZ', 'kl-GL',
|
||||
// 'ko-KR', 'lt-LT', 'ms-MY', 'nb-NO', 'nn-NO', 'pl-PL', 'pt-PT', 'ro-RO', 'ru-RU', 'sk-SK',
|
||||
// 'sr-RS', 'th-TH', 'tr-TR', 'uk-UA', 'vi-VN', 'zh-CN', 'zh-HK', 'zh-TW']).
|
||||
isMobilePhone(str: string, locale: MobilePhoneLocale): boolean;
|
||||
isMobilePhone(str: string, locale: MobilePhoneLocale, options?: IsMobilePhoneOptions): boolean;
|
||||
|
||||
// check if the string is a valid hex-encoded representation of a MongoDB ObjectId
|
||||
// (http://docs.mongodb.org/manual/reference/object-id/).
|
||||
@@ -337,6 +337,11 @@ declare namespace ValidatorJS {
|
||||
max?: number;
|
||||
}
|
||||
|
||||
// options for isMobilePhone
|
||||
interface IsMobilePhoneOptions {
|
||||
strictMode?: boolean;
|
||||
}
|
||||
|
||||
// options for isURL
|
||||
interface IsURLOptions {
|
||||
protocols?: string[];
|
||||
|
||||
@@ -491,6 +491,8 @@ let any: any;
|
||||
|
||||
result = validator.isMimeType('sample');
|
||||
|
||||
let isMobilePhoneOptions: ValidatorJS.IsMobilePhoneOptions;
|
||||
result = validator.isMobilePhone('sample', 'any', isMobilePhoneOptions);
|
||||
result = validator.isMobilePhone('sample', 'ar-AE');
|
||||
result = validator.isMobilePhone('sample', 'ar-DZ');
|
||||
result = validator.isMobilePhone('sample', 'ar-EG');
|
||||
|
||||
Reference in New Issue
Block a user