class-validator APIs
- IsString
- IsNotEmpty
- IsEmail
- IsOptional
- IsNumber
- IsEnum
- IsBoolean
- MinLength
- IsInt
- validate
- MaxLength
- IsArray
- Length
- ValidateNested
- Min
- IsDate
- Matches
- ValidationError
- Max
- IsUrl
- IsIn
- ValidationOptions
- ValidationArguments
- IsDefined
- registerDecorator
- IsObject
- ValidateIf
- ValidatorConstraint
- IsUUID
- ValidatorConstraintInterface
- IsPositive
- validateSync
- validateOrReject
- Validate
- Equals
- isArray
- IsAlphanumeric
- ArrayMinSize
- isString
- IsJSON
- IsMongoId
- IsDateString
- isUUID
- isISO8601
- IsBooleanString
- IsLongitude
- ArrayNotEmpty
- IsLatitude
- useContainer
- IsInstance
- IsAlpha
- isBoolean
- isDefined
- IsJWT
- IsSemVer
- MetadataStorage
- ValidateBy
- getFromContainer
- Allow
- ArrayUnique
- IsLowercase
- IsIP
- ArrayMaxSize
- IsISO31661Alpha3
- IsPhoneNumber
- IsHash
- IsNegative
- IsDecimal
- IsNumberString
- IsNotIn
- IsEmpty
- matches
- isMongoId
- MinDate
- IsRFC3339
- Validator
- ValidatePromise
- IsISO8601
- isNotEmpty
- isEmpty
- IsMobilePhone
- NotContains
- isNumber
- IsHexColor
- isObject
Other Related APIs
class-validator#IsIP TypeScript Examples
The following examples show how to use
class-validator#IsIP.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ip.dto.ts From life-helper-backend with MIT License | 6 votes |
@ApiProperty({
description: 'IP 地址,仅限 IPv4',
})
@IsOptional()
@IsIP('4')
ip?: string