@Contains(seed: string) |
Checks if the string contains the seed. |
是否包含種子 |
@NotContains(seed: string) |
Checks if the string not contains the seed. |
是否不包含種子 |
@IsAlpha() |
Checks if the string contains only letters (a-zA-Z). |
是否只包含字母 |
@IsAlphanumeric() |
Checks if the string contains only letters and numbers. |
是否只包含字母和數字 |
@IsDecimal(options?: IsDecimalOptions) |
Checks if the string is a valid decimal value. Default IsDecimalOptions are force_decimal=False , decimal_digits: '1,' , locale: 'en-US' |
是否為有效的十進制值。默認的IsDecimalOptions是force_decimal=False,decimal_digits:‘1’,locale:‘en-US’ |
@IsAscii() |
Checks if the string contains ASCII chars only. |
是否只包含ASCII字符 |
@IsBase32() |
Checks if a string is base32 encoded. |
是否是base32編碼的 |
@IsBase64() |
Checks if a string is base64 encoded. |
是否是base64編碼的 |
@IsIBAN() |
Checks if a string is a IBAN (International Bank Account Number). |
是否為IBAN(國際銀行帳號) |
@IsBIC() |
Checks if a string is a BIC (Bank Identification Code) or SWIFT code. |
是BIC(銀行識別碼)還是SWIFT碼 |
@IsByteLength(min: number, max?: number) |
Checks if the string’s length (in bytes) falls in a range. |
長度(以字節為單位)是否在某個范圍內 |
@IsCreditCard() |
Checks if the string is a credit card. |
是否為信用卡 |
@IsCurrency(options?: IsCurrencyOptions) |
Checks if the string is a valid currency amount. |
是否為有效的貨幣金額 |
@IsEthereumAddress() |
Checks if the string is an Ethereum address using basic regex. Does not validate address checksums. |
是否是以太坊地址。不驗證地址校驗和 |
@IsBtcAddress() |
Checks if the string is a valid BTC address. |
是否為有效的BTC地址 |
@IsDataURI() |
Checks if the string is a data uri format. |
是否為數據uri格式 |
@IsEmail(options?: IsEmailOptions) |
Checks if the string is an email. |
是否為電子郵件 |
@IsFQDN(options?: IsFQDNOptions) |
Checks if the string is a fully qualified domain name (e.g. domain.com). |
是否是完全限定的域名(例如domain.com) |
@IsFullWidth() |
Checks if the string contains any full-width chars. |
是否包含任何全角字符 |
@IsHalfWidth() |
Checks if the string contains any half-width chars. |
是否包含任何半角字符 |
@IsVariableWidth() |
Checks if the string contains a mixture of full and half-width chars. |
是否包含全半角字符 |
@IsHexColor() |
Checks if the string is a hexadecimal color. |
是否為十六進制顏色 |
@IsHSLColor() |
Checks if the string is an HSL color based on CSS Colors Level 4 specification. |
是否是基於CSS Colors Level 4規范的HSL顏色 |
@IsRgbColor(options?: IsRgbOptions) |
Checks if the string is a rgb or rgba color. |
是rgb還是rgba顏色 |
@IsIdentityCard(locale?: string) |
Checks if the string is a valid identity card code. |
是否是有效的身份證代碼(估計是國外的身份證格式) |
@IsPassportNumber(countryCode?: string) |
Checks if the string is a valid passport number relative to a specific country code. |
是否是相對於特定國家代碼的有效護照號碼 |
@IsPostalCode(locale?: string) |
Checks if the string is a postal code. |
是否是郵政編碼 |
@IsHexadecimal() |
Checks if the string is a hexadecimal number. |
是否為十六進制數 |
@IsOctal() |
Checks if the string is a octal number. |
是否為八進制數 |
@IsMACAddress(options?: IsMACAddressOptions) |
Checks if the string is a MAC Address. |
是否為MAC地址 |
@IsIP(version?: "4"\|"6") |
Checks if the string is an IP (version 4 or 6). |
是否為IP(版本4或6) |
@IsPort() |
Checks if the string is a valid port number. |
是否為有效的端口號 |
@IsISBN(version?: "10"\|"13") |
Checks if the string is an ISBN (version 10 or 13). |
是否為ISBN(版本10或13) |
@IsEAN() |
Checks if the string is an if the string is an EAN (European Article Number). |
是否為EAN(歐洲商品編號) |
@IsISIN() |
Checks if the string is an ISIN (stock/security identifier). |
是否為ISIN(股票/安全標識符) |
@IsISO8601(options?: IsISO8601Options) |
Checks if the string is a valid ISO 8601 date format. Use the option strict = true for additional checks for a valid date. |
是否為有效的ISO 8601日期格式。對於有效日期的其他檢查,請使用選項strict=true。 |
@IsJSON() |
Checks if the string is valid JSON. |
是否為有效的JSON |
@IsJWT() |
Checks if the string is valid JWT. |
是否為有效的JWT |
@IsObject() |
Checks if the object is valid Object (null, functions, arrays will return false). |
是否為有效對象(null、函數、數組將返回false) |
@IsNotEmptyObject() |
Checks if the object is not empty. |
對象是否為空 |
@IsLowercase() |
Checks if the string is lowercase. |
是否為小寫 |
@IsLatLong() |
Checks if the string is a valid latitude-longitude coordinate in the format lat, long. |
是否為lat,long格式的有效經緯度坐標 |
@IsLatitude() |
Checks if the string or number is a valid latitude coordinate. |
檢查字符串或數字是否是有效的緯度坐標 |
@IsLongitude() |
Checks if the string or number is a valid longitude coordinate. |
檢查字符串或數字是否為有效的經度坐標 |
@IsMobilePhone(locale: string) |
Checks if the string is a mobile phone number. |
是否是移動電話號碼 |
@IsISO31661Alpha2() |
Checks if the string is a valid ISO 3166-1 alpha-2 officially assigned country code. |
是否是有效的iso3166-1alpha-2官方指定的國家代碼。 |
@IsISO31661Alpha3() |
Checks if the string is a valid ISO 3166-1 alpha-3 officially assigned country code. |
是否是有效的iso3166-1alpha-3官方指定的國家代碼。 |
@IsLocale() |
Checks if the string is a locale. |
是否為區域設置 |
@IsPhoneNumber(region: string) |
Checks if the string is a valid phone numberusing libphonenumber-js. |
是否是有效的電話號碼 |
@IsMongoId() |
Checks if the string is a valid hex-encoded representation of a MongoDB ObjectId. |
是否是MongoDB ObjectId的有效十六進制編碼表示形式 |
@IsMultibyte() |
Checks if the string contains one or more multibyte chars. |
是否包含一個或多個多字節字符 |
@IsNumberString(options?: IsNumericOptions) |
Checks if the string is numeric. |
是否包含任何代理項對字符 |
@IsSurrogatePair() |
Checks if the string contains any surrogate pairs chars. |
是否包含任何代理項對字符 |
@IsUrl(options?: IsURLOptions) |
Checks if the string is an url. |
是否為url |
@IsMagnetURI() |
Checks if the string is a magnet uri format. |
是否為magneturi格式 |
@IsUUID(version?: "3"\|"4"\|"5"\|"all") |
Checks if the string is a UUID (version 3, 4, 5 or all ). |
是否是UUID(version 3、4、5或all) |
@IsFirebasePushId() |
Checks if the string is a Firebase Push ID |
是否為Firebase Push ID |
@IsUppercase() |
Checks if the string is uppercase. |
是否為大寫 |
@Length(min: number, max?: number) |
Checks if the string’s length falls in a range. |
符串的長度是否在某個范圍內 |
@MinLength(min: number) |
Checks if the string’s length is not less than given number. |
字符串的長度是否不小於給定的數字 |
@MaxLength(max: number) |
Checks if the string’s length is not more than given number. |
字符串的長度是否不大於給定的數字 |
@Matches(pattern: RegExp, modifiers?: string) |
Checks if string matches the pattern. Either matches(‘foo’, /foo/i) or matches(‘foo’, ‘foo’, ‘i’). |
是否與模式匹配,匹配(‘foo’,/foo/i)或匹配(‘foo’,‘foo’,‘i’) |
@IsMilitaryTime() |
Checks if the string is a valid representation of military time in the format HH:MM. |
是否是HH:MM格式的有效軍事時間表示形式 |
@IsHash(algorithm: string) |
Checks if the string is a hash The following types are supported:md4 , md5 , sha1 , sha256 , sha384 , sha512 , ripemd128 , ripemd160 , tiger128 , tiger160 , tiger192 , crc32 , crc32b . |
是否是散列,以下類型是supported:md4、md5、sha1、sha256、sha384、sha512、ripemd128、ripemd160、tiger128、tiger128、tiger192、crc32、crc32b。 |
@IsMimeType() |
Checks if the string matches to a valid MIME type format |
是否與有效的MIME類型格式匹配 |
@IsSemVer() |
Checks if the string is a Semantic Versioning Specification (SemVer). |
是否為語義版本控制規范(SemVer) |
@IsISSN(options?: IsISSNOptions) |
Checks if the string is a ISSN. |
是否為ISSN |
@IsISRC() |
Checks if the string is a ISRC. |
是否為ISRC |
@IsRFC3339() |
Checks if the string is a valid RFC 3339 date. |
是否為有效的RFC 3339日期 |