@types/validator
Advanced tools
| import validator from "../../"; | ||
| export type IsAfterOptions = validator.IsAfterOptions; | ||
| export default validator.isAfter; |
| import validator from "../../"; | ||
| export type IsBase32Options = validator.IsBase32Options; | ||
| export default validator.isBase32; |
| import validator from "../../"; | ||
| export type IsBeforeOptions = validator.IsBeforeOptions; | ||
| export default validator.isBefore; |
| import validator from "../../"; | ||
| export type IsJSONOptions = validator.IsJSONOptions; | ||
| export default validator.isJSON; |
| import validator from "../../"; | ||
| export type MobilePhoneLocale = validator.MobilePhoneLocale; | ||
| export type IsMobilePhoneOptions = validator.IsMobilePhoneOptions; | ||
| export const locales: MobilePhoneLocale[]; | ||
| export default validator.isMobilePhone; |
| import validator from "../../"; | ||
| export type PostalCodeLocale = validator.PostalCodeLocale; | ||
| export const locales: PostalCodeLocale[]; | ||
| export default validator.isPostalCode; |
| import validator from "../../"; | ||
| export type StrongPasswordOptions = validator.StrongPasswordOptions; | ||
| export default validator.isStrongPassword; |
| import validator from "../../"; | ||
| export type VATCountryCode = validator.VATCountryCode; | ||
| export default validator.isVAT; |
+205
-9
@@ -48,2 +48,10 @@ import * as _isBoolean from "./lib/isBoolean"; | ||
| export interface IsAfterOptions { | ||
| /** | ||
| * Date to compare to. | ||
| * @default Date().toString() | ||
| */ | ||
| comparisonDate?: string | undefined; | ||
| } | ||
| /** | ||
@@ -54,3 +62,3 @@ * Check if the string is a date that's after the specified date. | ||
| */ | ||
| export function isAfter(str: string, date?: string): boolean; | ||
| export function isAfter(str: string, dateStringOrOptions?: string | IsAfterOptions): boolean; | ||
@@ -208,6 +216,15 @@ export type AlphaLocale = | ||
| export interface IsBase32Options { | ||
| /** | ||
| * If true, it tests the given base32 encoded string using [Crockford's base32 alternative](http://www.crockford.com/base32.html). | ||
| * @default false | ||
| */ | ||
| crockford?: boolean | undefined; | ||
| } | ||
| /** | ||
| * Check if a string is base32 encoded. | ||
| */ | ||
| export function isBase32(str: string): boolean; | ||
| export function isBase32(str: string, options?: IsBase32Options): boolean; | ||
| /** | ||
@@ -237,2 +254,10 @@ * check if a string is base58 encoded | ||
| export interface IsBeforeOptions { | ||
| /** | ||
| * Date to compare to. | ||
| * @default Date().toString() | ||
| */ | ||
| comparisonDate?: string | undefined; | ||
| } | ||
| /** | ||
@@ -243,3 +268,3 @@ * Check if the string is a date that's before the specified date. | ||
| */ | ||
| export function isBefore(str: string, date?: string): boolean; | ||
| export function isBefore(str: string, dateStringOrOptions?: string | IsBeforeOptions): boolean; | ||
@@ -811,6 +836,13 @@ export const isIBAN: typeof _isIBAN.default; | ||
| export interface IsJSONOptions { | ||
| /** | ||
| * If true, the primitives 'true', 'false' and 'null' are accepted as valid JSON values. | ||
| * @default false | ||
| */ | ||
| allow_primitives?: boolean | undefined; | ||
| } | ||
| /** | ||
| * Check if the string is valid JSON (note: uses `JSON.parse`). | ||
| */ | ||
| export function isJSON(str: string): boolean; | ||
| export function isJSON(str: string, options?: IsJSONOptions): boolean; | ||
@@ -951,6 +983,9 @@ /** | ||
| | "ar-OM" | ||
| | "ar-PS" | ||
| | "ar-SA" | ||
| | "ar-SD" | ||
| | "ar-SY" | ||
| | "ar-TN" | ||
| | "az-AZ" | ||
| | "ar-QA" | ||
| | "bs-BA" | ||
@@ -967,7 +1002,14 @@ | "be-BY" | ||
| | "de-LU" | ||
| | "dv-MV" | ||
| | "el-GR" | ||
| | "el-CY" | ||
| | "en-AI" | ||
| | "en-AU" | ||
| | "en-AG" | ||
| | "en-BM" | ||
| | "en-BS" | ||
| | "en-GB" | ||
| | "en-GG" | ||
| | "en-GH" | ||
| | "en-GY" | ||
| | "en-HK" | ||
@@ -977,7 +1019,16 @@ | "en-MO" | ||
| | "en-IN" | ||
| | "en-JM" | ||
| | "en-KE" | ||
| | "fr-CF" | ||
| | "en-SS" | ||
| | "en-KI" | ||
| | "en-KN" | ||
| | "en-LS" | ||
| | "en-MT" | ||
| | "en-MU" | ||
| | "en-MW" | ||
| | "en-NA" | ||
| | "en-NG" | ||
| | "en-NZ" | ||
| | "en-PG" | ||
| | "en-PK" | ||
@@ -994,2 +1045,3 @@ | "en-PH" | ||
| | "en-ZW" | ||
| | "en-BW" | ||
| | "es-AR" | ||
@@ -1000,2 +1052,3 @@ | "es-BO" | ||
| | "es-CR" | ||
| | "es-CU" | ||
| | "es-DO" | ||
@@ -1008,4 +1061,6 @@ | "es-HN" | ||
| | "es-MX" | ||
| | "es-NI" | ||
| | "es-PA" | ||
| | "es-PY" | ||
| | "es-SV" | ||
| | "es-UY" | ||
@@ -1018,2 +1073,6 @@ | "es-VE" | ||
| | "fo-FO" | ||
| | "fr-BF" | ||
| | "fr-BJ" | ||
| | "fr-CD" | ||
| | "fr-CM" | ||
| | "fr-FR" | ||
@@ -1023,6 +1082,9 @@ | "fr-GF" | ||
| | "fr-MQ" | ||
| | "fr-PF" | ||
| | "fr-RE" | ||
| | "fr-WF" | ||
| | "he-IL" | ||
| | "hu-HU" | ||
| | "id-ID" | ||
| | "ir-IR" | ||
| | "it-IT" | ||
@@ -1035,5 +1097,8 @@ | "it-SM" | ||
| | "ko-KR" | ||
| | "ky-KG" | ||
| | "lt-LT" | ||
| | "lv-LV" | ||
| | "mk-MK" | ||
| | "mg-MG" | ||
| | "mn-MN" | ||
| | "my-MM" | ||
| | "ms-MY" | ||
@@ -1045,2 +1110,3 @@ | "mz-MZ" | ||
| | "nl-NL" | ||
| | "nl-AW" | ||
| | "nn-NO" | ||
@@ -1051,2 +1117,3 @@ | "pl-PL" | ||
| | "pt-AO" | ||
| | "ro-MD" | ||
| | "ro-RO" | ||
@@ -1057,7 +1124,10 @@ | "ru-RU" | ||
| | "sk-SK" | ||
| | "so-SO" | ||
| | "sq-AL" | ||
| | "sr-RS" | ||
| | "sv-SE" | ||
| | "tg-TJ" | ||
| | "th-TH" | ||
| | "tr-TR" | ||
| | "tk-TM" | ||
| | "uk-UA" | ||
@@ -1067,3 +1137,8 @@ | "uz-UZ" | ||
| | "zh-CN" | ||
| | "zh-TW"; | ||
| | "zh-TW" | ||
| | "dz-BT" | ||
| | "ar-YE" | ||
| | "ar-EH" | ||
| | "fa-AF" | ||
| | "mk-MK"; | ||
| export type PhoneLocaleAlias = "en-CA" | "fr-CA" | "fr-BE" | "zh-HK" | "zh-MO" | "ga-IE" | "fr-CH" | "it-CH"; | ||
@@ -1142,5 +1217,9 @@ | ||
| | "AU" | ||
| | "AZ" | ||
| | "BA" | ||
| | "BD" | ||
| | "BE" | ||
| | "BG" | ||
| | "BR" | ||
| | "BY" | ||
| | "CA" | ||
@@ -1153,2 +1232,3 @@ | "CH" | ||
| | "DK" | ||
| | "DO" | ||
| | "DZ" | ||
@@ -1162,2 +1242,3 @@ | "EE" | ||
| | "HR" | ||
| | "HT" | ||
| | "HU" | ||
@@ -1178,7 +1259,12 @@ | "ID" | ||
| | "LV" | ||
| | "LK" | ||
| | "MG" | ||
| | "MX" | ||
| | "MT" | ||
| | "MY" | ||
| | "NL" | ||
| | "NO" | ||
| | "NP" | ||
| | "NZ" | ||
| | "PK" | ||
| | "PL" | ||
@@ -1191,4 +1277,6 @@ | "PR" | ||
| | "SE" | ||
| | "SG" | ||
| | "SI" | ||
| | "SK" | ||
| | "TH" | ||
| | "TN" | ||
@@ -1220,13 +1308,49 @@ | "TW" | ||
| export interface StrongPasswordOptions { | ||
| /** | ||
| * @default 8 | ||
| */ | ||
| minLength?: number | undefined; | ||
| /** | ||
| * @default 1 | ||
| */ | ||
| minLowercase?: number | undefined; | ||
| /** | ||
| * @default 1 | ||
| */ | ||
| minUppercase?: number | undefined; | ||
| /** | ||
| * @default 1 | ||
| */ | ||
| minNumbers?: number | undefined; | ||
| /** | ||
| * @default 1 | ||
| */ | ||
| minSymbols?: number | undefined; | ||
| /** | ||
| * @default false | ||
| */ | ||
| returnScore?: boolean | undefined; | ||
| /** | ||
| * @default 1 | ||
| */ | ||
| pointsPerUnique?: number | undefined; | ||
| /** | ||
| * @default 0.5 | ||
| */ | ||
| pointsPerRepeat?: number | undefined; | ||
| /** | ||
| * @default 10 | ||
| */ | ||
| pointsForContainingLower?: number | undefined; | ||
| /** | ||
| * @default 10 | ||
| */ | ||
| pointsForContainingUpper?: number | undefined; | ||
| /** | ||
| * @default 10 | ||
| */ | ||
| pointsForContainingNumber?: number | undefined; | ||
| /** | ||
| * @default 10 | ||
| */ | ||
| pointsForContainingSymbol?: number | undefined; | ||
@@ -1239,3 +1363,4 @@ } | ||
| ): boolean; | ||
| export function isStrongPassword(str: string, options: StrongPasswordOptions & { returnScore: true }): number; | ||
| export function isStrongPassword(str: string, options?: StrongPasswordOptions & { returnScore: true }): number; | ||
| export function isStrongPassword(str: string, options?: StrongPasswordOptions): boolean | number; | ||
@@ -1314,6 +1439,77 @@ /** | ||
| export type VATCountryCode = | ||
| | "AT" | ||
| | "BE" | ||
| | "BG" | ||
| | "HR" | ||
| | "CY" | ||
| | "CZ" | ||
| | "DK" | ||
| | "EE" | ||
| | "FI" | ||
| | "FR" | ||
| | "DE" | ||
| | "EL" | ||
| | "HU" | ||
| | "IE" | ||
| | "IT" | ||
| | "LV" | ||
| | "LT" | ||
| | "LU" | ||
| | "MT" | ||
| | "NL" | ||
| | "PL" | ||
| | "PT" | ||
| | "RO" | ||
| | "SK" | ||
| | "SI" | ||
| | "ES" | ||
| | "SE" | ||
| | "AL" | ||
| | "MK" | ||
| | "AU" | ||
| | "BY" | ||
| | "CA" | ||
| | "IS" | ||
| | "IN" | ||
| | "ID" | ||
| | "IL" | ||
| | "KZ" | ||
| | "NZ" | ||
| | "NG" | ||
| | "NO" | ||
| | "PH" | ||
| | "RU" | ||
| | "SM" | ||
| | "SA" | ||
| | "RS" | ||
| | "CH" | ||
| | "TR" | ||
| | "UA" | ||
| | "GB" | ||
| | "UZ" | ||
| | "AR" | ||
| | "BO" | ||
| | "BR" | ||
| | "CL" | ||
| | "CO" | ||
| | "CR" | ||
| | "EC" | ||
| | "SV" | ||
| | "GT" | ||
| | "HN" | ||
| | "MX" | ||
| | "NI" | ||
| | "PA" | ||
| | "PY" | ||
| | "PE" | ||
| | "DO" | ||
| | "UY" | ||
| | "VE"; | ||
| /** | ||
| * Checks that the string is a [valid VAT number | ||
| * check if the string is a [valid VAT number](https://en.wikipedia.org/wiki/VAT_identification_number) | ||
| * if validation is available for the given country code | ||
| */ | ||
| export function isVAT(str: string, countryCode: string): boolean; | ||
| export function isVAT(str: string, countryCode: VATCountryCode): boolean; | ||
@@ -1320,0 +1516,0 @@ /** |
| import validator from "../"; | ||
| export type IsAfterOptions = validator.IsAfterOptions; | ||
| export default validator.isAfter; |
| import validator from "../"; | ||
| export type IsBase32Options = validator.IsBase32Options; | ||
| export default validator.isBase32; |
| import validator from "../"; | ||
| export type IsBeforeOptions = validator.IsBeforeOptions; | ||
| export default validator.isBefore; |
| import validator from "../"; | ||
| export type IsJSONOptions = validator.IsJSONOptions; | ||
| export default validator.isJSON; |
| import validator from "../"; | ||
| export type MobilePhoneLocale = validator.MobilePhoneLocale; | ||
| export type IsMobilePhoneOptions = validator.IsMobilePhoneOptions; | ||
| export const locales: MobilePhoneLocale[]; | ||
| export default validator.isMobilePhone; |
| import validator from "../"; | ||
| export type PostalCodeLocale = validator.PostalCodeLocale; | ||
| export const locales: PostalCodeLocale[]; | ||
| export default validator.isPostalCode; |
| import validator from "../"; | ||
| export type StrongPasswordOptions = validator.StrongPasswordOptions; | ||
| export default validator.isStrongPassword; |
| import validator from "../"; | ||
| export type VATCountryCode = validator.VATCountryCode; | ||
| export default validator.isVAT; |
| { | ||
| "name": "@types/validator", | ||
| "version": "13.15.4", | ||
| "version": "13.15.5", | ||
| "description": "TypeScript definitions for validator", | ||
@@ -89,4 +89,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/validator", | ||
| "peerDependencies": {}, | ||
| "typesPublisherContentHash": "4ba6d4a869dff414b8a1bf1375403c45ca0eec4352eaa63773e3b6a16071d6c6", | ||
| "typesPublisherContentHash": "0405d0c229de3bc67d6be86d5453e1c79e6fefa96cd923380eda34472f022806", | ||
| "typeScriptVersion": "5.2" | ||
| } |
@@ -11,3 +11,3 @@ # Installation | ||
| ### Additional Details | ||
| * Last updated: Mon, 27 Oct 2025 23:02:29 GMT | ||
| * Last updated: Tue, 11 Nov 2025 21:02:11 GMT | ||
| * Dependencies: none | ||
@@ -14,0 +14,0 @@ |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
80639
6.15%2757
8.12%4
-50%