class-validator#MinLength TypeScript Examples
The following examples show how to use
class-validator#MinLength.
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.dto.ts From nestjs-starter with MIT License | 6 votes |
@ApiProperty({
description: 'Username for your account, must be unique.',
})
@IsUsernameAlreadyExist({
message: 'Username $value already exists. Choose another username.',
})
@IsString()
@MinLength(8)
@MaxLength(20)
@Matches(PATTERN_VALID_USERNAME, {
message: `Username $value don't have a valid format`,
})
@IsNotEmpty()
username!: string;
Example #2
Source File: create-user.request.dto.ts From domain-driven-hexagon with MIT License | 6 votes |
@ApiProperty({
example: '[email protected]',
description: 'User email address',
})
@MaxLength(320)
@MinLength(5)
@IsEmail()
@Field() // <- only if you are using graphql
readonly email: string;
Example #3
Source File: CreateUserRequest.ts From spurtcommerce with BSD 3-Clause "New" or "Revised" License | 6 votes |
@MaxLength(10, {
message: 'password is maximum 10 character',
})
@MinLength(5, {
message: 'password is minimum 5 character',
})
@IsNotEmpty({
message: 'password is required',
})
public password: string;
Example #4
Source File: user.ts From Deep-Lynx with MIT License | 5 votes |
@IsString()
@MinLength(1)
display_name = '';
Example #5
Source File: user.create.input.ts From api with GNU Affero General Public License v3.0 | 5 votes |
@Field()
@MinLength(2)
@MaxLength(50)
username: string
Example #6
Source File: user.dto.ts From postgres-nest-react-typescript-boilerplate with GNU General Public License v3.0 | 5 votes |
@MinLength(6)
password: string;
Example #7
Source File: metatype_relationship_pair.ts From Deep-Lynx with MIT License | 5 votes |
@IsNotEmpty()
@IsString()
@MinLength(1)
name = '';
Example #8
Source File: user-update.dto.ts From bank-server with MIT License | 5 votes |
@IsString()
@ApiProperty()
@MinLength(6)
@ApiProperty({ minLength: 6 })
@IsOptional()
readonly password?: string;
Example #9
Source File: user.ts From Deep-Lynx with MIT License | 5 votes |
@IsString()
@MinLength(1)
display_name = '';
Example #10
Source File: register.dto.ts From nestjs-rest-sample with GNU General Public License v3.0 | 5 votes |
@IsNotEmpty()
@MinLength(8, { message: " The min length of password is 8 " })
@MaxLength(20, { message: " The password can't accept more than 20 characters " })
// @Matches(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,20}$/,
// { message: " A password at least contains one numeric digit, one supercase char and one lowercase char" }
// )
readonly password: string;
Example #11
Source File: get-token-list.dto.ts From etherspot-sdk with MIT License | 5 votes |
@IsOptional()
@IsString()
@MinLength(TOKEN_LIST_MIN_NAME_LENGTH)
@MaxLength(TOKEN_LIST_MAX_NAME_LENGTH)
name?: string = null;
Example #12
Source File: Users.ts From mysql_node_angular with MIT License | 5 votes |
@Column()
@MinLength(6)
@IsNotEmpty()
password: string;
Example #13
Source File: role.validator.ts From ddd-cqrs-es-aws-sam with MIT License | 5 votes |
@IsAlpha()
@MinLength(1)
@MaxLength(30)
name!: string;
Example #14
Source File: register-user.dto.ts From codeclannigeria-backend with MIT License | 5 votes |
@MinLength(6)
password: string;
Example #15
Source File: classes.ts From epicgames-freegames-node with MIT License | 5 votes |
/**
* Epic Games login password
* @example abc1234
* @env PASSWORD
*/
@IsString()
@MinLength(7)
password: string;
Example #16
Source File: UpdateProfileCommand.ts From test with BSD 3-Clause "New" or "Revised" License | 5 votes |
@IsOptional()
@MinLength(1, {
message: messages.minLength.defaultMessage,
})
address: string
Example #17
Source File: CreateJobRequest.ts From spurtcommerce with BSD 3-Clause "New" or "Revised" License | 5 votes |
@MaxLength(15, {
message: 'mobile number is maximum 15 character',
})
@MinLength(8, {
message: 'mobile number is minimum 8 character',
})
public contactPersonMobile: number;
Example #18
Source File: login-by-pwd.dto.ts From pknote-backend with GNU General Public License v3.0 | 5 votes |
@ApiProperty({ description: '登录密码' })
@IsString()
@MinLength(6, { message: '密码长度不能小于6!' })
@MaxLength(20, { message: '密码长度不能大于20!' })
@Matches(/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/, {
message: '密码强度太低!',
})
readonly pwd: string;
Example #19
Source File: changePasswordRequest.ts From spurtcommerce with BSD 3-Clause "New" or "Revised" License | 5 votes |
@MinLength(5, {
message: 'New Password is minimum 5 character',
})
@IsNotEmpty({
message: 'New Password is required',
})
public newPassword: string;
Example #20
Source File: user.create.input.ts From api with GNU Affero General Public License v3.0 | 5 votes |
@Field()
@MinLength(5)
password: string
Example #21
Source File: CreateFolderNameRequest.ts From spurtcommerce with BSD 3-Clause "New" or "Revised" License | 5 votes |
@IsNotEmpty()
@MinLength(4, {
message: 'folder is minimum 4 character',
})
public folderName: string;
Example #22
Source File: user-profile.model.ts From nestjs-angular-starter with MIT License | 5 votes |
@MinLength(6)
password: string;
Example #23
Source File: UpdateProfileCommand.ts From test with BSD 3-Clause "New" or "Revised" License | 5 votes |
@MinLength(1, {
message: messages.minLength.defaultMessage,
})
firstName: string
Example #24
Source File: user-register.dto.ts From bank-server with MIT License | 5 votes |
@IsString()
@MinLength(6)
@ApiProperty({ minLength: 6 })
readonly password: string;
Example #25
Source File: user.dto.ts From nest-js-boilerplate with MIT License | 5 votes |
@ApiProperty({
type: String,
})
@IsNotEmpty()
@IsString()
@MinLength(1)
@IsEmail()
readonly email: string = '';
Example #26
Source File: create-user.request.dto.ts From domain-driven-hexagon with MIT License | 5 votes |
@ApiProperty({ example: 'Grande Rue', description: 'Street' })
@MaxLength(50)
@MinLength(5)
@Matches(/^[a-zA-Z ]*$/)
@Field() // <- only if you are using graphql
readonly street: string;
Example #27
Source File: user.dto.ts From nest-js-boilerplate with MIT License | 5 votes |
@ApiProperty({ type: String })
@IsNotEmpty()
@IsString()
@MinLength(1)
readonly lastName?: string = '';
Example #28
Source File: create-application.dto.ts From uniauth-backend with MIT License | 5 votes |
/** name of the application */
@ApiProperty({ description: 'name to identify applicaiton in your console', example: 'simple oauth' })
@IsNotEmpty()
@MinLength(3)
@MaxLength(255)
name: string;
Example #29
Source File: sign-up.dto.ts From nest-js-boilerplate with MIT License | 5 votes |
@ApiProperty({ type: String })
@IsNotEmpty()
@IsString()
@MinLength(8)
@MaxLength(64)
readonly password: string = '';