File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -887,7 +887,7 @@ isBoolean(value);
887887| ` @IsTaxId() ` | Checks if the string is a valid tax ID. Default locale is ` en-US ` .
888888| ` @IsUrl(options?: IsURLOptions) ` | Checks if the string is a URL. |
889889| ` @IsMagnetURI() ` | Checks if the string is a [ magnet uri format] ( https://en.wikipedia.org/wiki/Magnet_URI_scheme ) . |
890- | ` @IsUUID(version?: "3"\|"4"\|"5"\|"all" ) ` | Checks if the string is a UUID (version 3, 4, 5 or all ). |
890+ | ` @IsUUID(version?: UUIDVersion ) ` | Checks if the string is a UUID (version 3, 4, 5 or all ). |
891891| ` @IsFirebasePushId() ` | Checks if the string is a [ Firebase Push ID] ( https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html ) |
892892| ` @IsUppercase() ` | Checks if the string is uppercase. |
893893| ` @Length(min: number, max?: number) ` | Checks if the string's length falls in a range. |
Original file line number Diff line number Diff line change 11import { ValidationOptions } from '../ValidationOptions' ;
22import { buildMessage , ValidateBy } from '../common/ValidateBy' ;
33import isUuidValidator from 'validator/lib/isUUID' ;
4-
5- export type UUIDVersion = '3' | '4' | '5' | 'all' | 3 | 4 | 5 ;
4+ import type ValidatorJS from 'validator' ;
65
76export const IS_UUID = 'isUuid' ;
87
98/**
109 * Checks if the string is a UUID (version 3, 4 or 5).
1110 * If given value is not a string, then it returns false.
1211 */
13- export function isUUID ( value : unknown , version ?: UUIDVersion ) : boolean {
12+ export function isUUID ( value : unknown , version ?: ValidatorJS . UUIDVersion ) : boolean {
1413 return typeof value === 'string' && isUuidValidator ( value , version ) ;
1514}
1615
1716/**
1817 * Checks if the string is a UUID (version 3, 4 or 5).
1918 * If given value is not a string, then it returns false.
2019 */
21- export function IsUUID ( version ?: UUIDVersion , validationOptions ?: ValidationOptions ) : PropertyDecorator {
20+ export function IsUUID ( version ?: ValidatorJS . UUIDVersion , validationOptions ?: ValidationOptions ) : PropertyDecorator {
2221 return ValidateBy (
2322 {
2423 name : IS_UUID ,
You can’t perform that action at this time.
0 commit comments