class-validator#IsAlphanumeric TypeScript Examples

The following examples show how to use class-validator#IsAlphanumeric. 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: create-user.request.dto.ts    From domain-driven-hexagon with MIT License 5 votes vote down vote up
@ApiProperty({ example: '28566', description: 'Postal code' })
  @MaxLength(10)
  @MinLength(4)
  @IsAlphanumeric()
  @Field() // <- only if you are using graphql
  readonly postalCode: string;
Example #2
Source File: find-users.request.dto.ts    From domain-driven-hexagon with MIT License 5 votes vote down vote up
@ApiProperty({ example: '28566', description: 'Postal code' })
  @IsOptional()
  @MaxLength(10)
  @IsAlphanumeric()
  @Field({ nullable: true }) // <- only if you are using GraphQL
  readonly postalCode: string;
Example #3
Source File: login.dto.ts    From life-helper-backend with MIT License 5 votes vote down vote up
/** 校验码 */
  @IsString()
  @IsNotEmpty()
  @IsAlphanumeric()
  code: string
Example #4
Source File: user-create-input.dto.ts    From nestjs-starter-rest-api with MIT License 5 votes vote down vote up
@ApiProperty()
  @IsNotEmpty()
  @Length(6, 100)
  @IsAlphanumeric()
  username: string;
Example #5
Source File: CreateCustomerRequest.ts    From spurtcommerce with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@IsNotEmpty()
    @IsAlphanumeric()
    @MinLength(5, {
        message: 'password is minimum 5 character',
    })
    public password: string;