Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ isBoolean(value);
| `@IsTaxId()` | Checks if the string is a valid tax ID. Default locale is `en-US`. |
| `@IsUrl(options?: IsURLOptions)` | Checks if the string is a URL. |
| `@IsMagnetURI()` | Checks if the string is a [magnet uri format](https://en.wikipedia.org/wiki/Magnet_URI_scheme). |
| `@IsUUID(version?: UUIDVersion)` | Checks if the string is a UUID (version 3, 4, 5 or all ). |
| `@IsUUID(version?: UUIDVersion)` | Checks if the string is a UUID (version 1-8, nil, max, loose, all). |
| `@IsFirebasePushId()` | Checks if the string is a [Firebase Push ID](https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html) |
| `@IsUppercase()` | Checks if the string is uppercase. |
| `@Length(min: number, max?: number)` | Checks if the string's length falls in a range. |
Expand Down
4 changes: 2 additions & 2 deletions src/decorator/string/IsUUID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import * as ValidatorJS from 'validator';
export const IS_UUID = 'isUuid';

/**
* Checks if the string is a UUID (version 3, 4 or 5).
* Checks if the string is a UUID (version 1-8, nil, max, loose, all).
* If given value is not a string, then it returns false.
*/
export function isUUID(value: unknown, version?: ValidatorJS.UUIDVersion): boolean {
return typeof value === 'string' && isUuidValidator(value, version);
}

/**
* Checks if the string is a UUID (version 3, 4 or 5).
* Checks if the string is a UUID (version 1-8, nil, max, loose, all).
* If given value is not a string, then it returns false.
*/
export function IsUUID(version?: ValidatorJS.UUIDVersion, validationOptions?: ValidationOptions): PropertyDecorator {
Expand Down
Loading