mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #11381 from TonyPythoneer/patch-1
[validator] Correct APIs
This commit is contained in:
@@ -19,8 +19,87 @@ let any: any;
|
||||
result = validator.isAfter('sample', new Date().toString());
|
||||
|
||||
result = validator.isAlpha('sample');
|
||||
result = validator.isAlpha('sample', 'ar');
|
||||
result = validator.isAlpha('sample', 'ar-AE');
|
||||
result = validator.isAlpha('sample', 'ar-BH');
|
||||
result = validator.isAlpha('sample', 'ar-DZ');
|
||||
result = validator.isAlpha('sample', 'ar-EG');
|
||||
result = validator.isAlpha('sample', 'ar-IQ');
|
||||
result = validator.isAlpha('sample', 'ar-JO');
|
||||
result = validator.isAlpha('sample', 'ar-KW');
|
||||
result = validator.isAlpha('sample', 'ar-LB');
|
||||
result = validator.isAlpha('sample', 'ar-LY');
|
||||
result = validator.isAlpha('sample', 'ar-MA');
|
||||
result = validator.isAlpha('sample', 'ar-QA');
|
||||
result = validator.isAlpha('sample', 'ar-QM');
|
||||
result = validator.isAlpha('sample', 'ar-SA');
|
||||
result = validator.isAlpha('sample', 'ar-SD');
|
||||
result = validator.isAlpha('sample', 'ar-SY');
|
||||
result = validator.isAlpha('sample', 'ar-TN');
|
||||
result = validator.isAlpha('sample', 'ar-YE');
|
||||
result = validator.isAlpha('sample', 'cs-CZ');
|
||||
result = validator.isAlpha('sample', 'de-DE');
|
||||
result = validator.isAlpha('sample', 'en-AU');
|
||||
result = validator.isAlpha('sample', 'en-GB');
|
||||
result = validator.isAlpha('sample', 'en-HK');
|
||||
result = validator.isAlpha('sample', 'en-IN');
|
||||
result = validator.isAlpha('sample', 'en-NZ');
|
||||
result = validator.isAlpha('sample', 'en-US');
|
||||
result = validator.isAlpha('sample', 'en-ZA');
|
||||
result = validator.isAlpha('sample', 'en-ZM');
|
||||
result = validator.isAlpha('sample', 'es-ES');
|
||||
result = validator.isAlpha('sample', 'fr-FR');
|
||||
result = validator.isAlpha('sample', 'hu-HU');
|
||||
result = validator.isAlpha('sample', 'nl-NL');
|
||||
result = validator.isAlpha('sample', 'pl-PL');
|
||||
result = validator.isAlpha('sample', 'pt-BR');
|
||||
result = validator.isAlpha('sample', 'pt-PT');
|
||||
result = validator.isAlpha('sample', 'ru-RU');
|
||||
result = validator.isAlpha('sample', 'sr-RS');
|
||||
result = validator.isAlpha('sample', 'sr-RS@latin');
|
||||
result = validator.isAlpha('sample', 'tr-TR');
|
||||
|
||||
result = validator.isAlphanumeric('sample');
|
||||
result = validator.isAlphanumeric('sample', 'ar');
|
||||
result = validator.isAlphanumeric('sample', 'ar-AE');
|
||||
result = validator.isAlphanumeric('sample', 'ar-BH');
|
||||
result = validator.isAlphanumeric('sample', 'ar-DZ');
|
||||
result = validator.isAlphanumeric('sample', 'ar-EG');
|
||||
result = validator.isAlphanumeric('sample', 'ar-IQ');
|
||||
result = validator.isAlphanumeric('sample', 'ar-JO');
|
||||
result = validator.isAlphanumeric('sample', 'ar-KW');
|
||||
result = validator.isAlphanumeric('sample', 'ar-LB');
|
||||
result = validator.isAlphanumeric('sample', 'ar-LY');
|
||||
result = validator.isAlphanumeric('sample', 'ar-MA');
|
||||
result = validator.isAlphanumeric('sample', 'ar-QA');
|
||||
result = validator.isAlphanumeric('sample', 'ar-QM');
|
||||
result = validator.isAlphanumeric('sample', 'ar-SA');
|
||||
result = validator.isAlphanumeric('sample', 'ar-SD');
|
||||
result = validator.isAlphanumeric('sample', 'ar-SY');
|
||||
result = validator.isAlphanumeric('sample', 'ar-TN');
|
||||
result = validator.isAlphanumeric('sample', 'ar-YE');
|
||||
result = validator.isAlphanumeric('sample', 'cs-CZ');
|
||||
result = validator.isAlphanumeric('sample', 'de-DE');
|
||||
result = validator.isAlphanumeric('sample', 'en-AU');
|
||||
result = validator.isAlphanumeric('sample', 'en-GB');
|
||||
result = validator.isAlphanumeric('sample', 'en-HK');
|
||||
result = validator.isAlphanumeric('sample', 'en-IN');
|
||||
result = validator.isAlphanumeric('sample', 'en-NZ');
|
||||
result = validator.isAlphanumeric('sample', 'en-US');
|
||||
result = validator.isAlphanumeric('sample', 'en-ZA');
|
||||
result = validator.isAlphanumeric('sample', 'en-ZM');
|
||||
result = validator.isAlphanumeric('sample', 'es-ES');
|
||||
result = validator.isAlphanumeric('sample', 'fr-FR');
|
||||
result = validator.isAlphanumeric('sample', 'fr-BE');
|
||||
result = validator.isAlphanumeric('sample', 'hu-HU');
|
||||
result = validator.isAlphanumeric('sample', 'nl-BE');
|
||||
result = validator.isAlphanumeric('sample', 'nl-NL');
|
||||
result = validator.isAlphanumeric('sample', 'pl-PL');
|
||||
result = validator.isAlphanumeric('sample', 'pt-BR');
|
||||
result = validator.isAlphanumeric('sample', 'pt-PT');
|
||||
result = validator.isAlphanumeric('sample', 'ru-RU');
|
||||
result = validator.isAlphanumeric('sample', 'sr-RS');
|
||||
result = validator.isAlphanumeric('sample', 'sr-RS@latin');
|
||||
result = validator.isAlphanumeric('sample', 'tr-TR');
|
||||
|
||||
result = validator.isAscii('sample');
|
||||
|
||||
|
||||
Vendored
+13
-4
@@ -4,6 +4,9 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace ValidatorJS {
|
||||
type AlphaLocale = "ar" | "ar-AE" | "ar-BH" | "ar-DZ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MA" | "ar-QA" | "ar-QM" | "ar-SA" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-YE" | "cs-CZ" | "de-DE" | "en-AU" | "en-GB" | "en-HK" | "en-IN" | "en-NZ" | "en-US" | "en-ZA" | "en-ZM" | "es-ES" | "fr-FR" | "hu-HU" | "nl-NL" | "pl-PL" | "pt-BR" | "pt-PT" | "ru-RU" | "sr-RS" | "sr-RS@latin" | "tr-TR";
|
||||
type AlphanumericLocale = "ar" | "ar-AE" | "ar-BH" | "ar-DZ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MA" | "ar-QA" | "ar-QM" | "ar-SA" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-YE" | "cs-CZ" | "de-DE" | "en-AU" | "en-GB" | "en-HK" | "en-IN" | "en-NZ" | "en-US" | "en-ZA" | "en-ZM" | "es-ES" | "fr-FR" | "fr-BE" | "hu-HU" | "nl-BE" | "nl-NL" | "pl-PL" | "pt-BR" | "pt-PT" | "ru-RU" | "sr-RS" | "sr-RS@latin" | "tr-TR";
|
||||
|
||||
interface ValidatorStatic {
|
||||
|
||||
// **************
|
||||
@@ -19,11 +22,17 @@ declare namespace ValidatorJS {
|
||||
// check if the string is a date that's after the specified date (defaults to now).
|
||||
isAfter(str: string, date?: string): boolean;
|
||||
|
||||
// check if the string contains only letters (a-zA-Z).
|
||||
isAlpha(str: string): boolean;
|
||||
// check if the string contains only letters (a-zA-Z). Locale is one of ['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG',
|
||||
// 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE',
|
||||
// 'cs-CZ', 'de-DE', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fr-FR', 'hu-HU',
|
||||
// 'nl-NL', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sr-RS', 'sr-RS@latin', 'tr-TR']) and defaults to en-US
|
||||
isAlpha(str: string, locale?: AlphaLocale): boolean;
|
||||
|
||||
// check if the string contains only letters and numbers.
|
||||
isAlphanumeric(str: string): boolean;
|
||||
// check if the string contains only letters and numbers. Locale is one of ['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG',
|
||||
// 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE',
|
||||
// 'cs-CZ', 'de-DE', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fr-FR', 'hu-HU',
|
||||
// 'nl-NL', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sr-RS', 'sr-RS@latin', 'tr-TR']) and defaults to en-US
|
||||
isAlphanumeric(str: string, locale?: AlphanumericLocale): boolean;
|
||||
|
||||
// check if the string contains ASCII chars only.
|
||||
isAscii(str: string): boolean;
|
||||
|
||||
Reference in New Issue
Block a user