@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. ...
652 validator.isUUID(str, version); // Checks if the string is a UUID (version 3, 4 or 5). 653 validator.isUppercase(str); // Checks if the string is uppercase. 654 validator.length(str, min, max); // Checks if the string's length falls in a range. 655 validator.minLength...
@IsNotIn(values: any[])Checks if value is not in a array of disallowed values.检查值是否不在不允许的值数组中 类型验证装饰器 修饰器描述(英⽂)描述(中⽂)@IsBoolean()Checks if a value is a boolean.是否为布尔值 @IsDate()Checks if the value is a date.是否为⽇期 @IsString()...
isUUID(str, version); // Checks if the string is a UUID (version 3, 4 or 5). validator.isUppercase(str); // Checks if the string is uppercase. validator.length(str, min, max); // Checks if the string's length falls in a range. validator.minLength(str, min); // Checks if ...
@IsUUID(version?: "3"|"4"|"5"|"all") Checks if the string is a UUID (version 3, 4, 5 or all ). @IsFirebasePushId() Checks if the string is a Firebase Push ID @IsUppercase() Checks if the string is uppercase. @Length(min: number, max?: number) Checks if the string's...
@IsUUID(version?: UUIDVersion) Checks if the string is a UUID (version 3, 4, 5 or all ). @IsFirebasePushId() Checks if the string is a Firebase Push ID @IsUppercase() Checks if the string is uppercase. @Length(min: number, max?: number) Checks if the string's length falls in...
@IsUUID(version?: UUIDVersion)Checks if the string is a UUID (version 3, 4, 5 or all ). @IsFirebasePushId()Checks if the string is aFirebase Push ID @IsUppercase()Checks if the string is uppercase. @Length(min: number, max?: number)Checks if the string's length falls in a rang...
前面两篇文章分别介绍了class-validator和class-transformer的使用,接着聊一下如何在nestjs中使用这两个包。 Nest.js自带数据验证,自带了三个开箱即用的管道:ValidationPipe、ParseIntPipe和ParseUUIDPipe, 其中ValidationPipe 配合class-validator就可以完美的实现我们想要的效果(对参数类型进行验证,验证失败抛出异常)。
880 | `@IsUUID(version?: "3"\|"4"\|"5"\|"all")` | Checks if the string is a UUID (version 3, 4, 5 or all ). | 881 | `@IsFirebasePushId()` | Checks if the string is a [Firebase Push ID](https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68...
Common | Decorator | Description | | | | | @IsDefined(value: any) | Checks if value is defined (!== undefined, !== null). This is the only decorator t