Skip to content

Instantly share code, notes, and snippets.

View JohanAltamar's full-sized avatar
🎯
Focusing

Johan Altamar JohanAltamar

🎯
Focusing
View GitHub Profile
@JohanAltamar
JohanAltamar / password-property-dto.ts
Created December 13, 2024 21:28 — forked from Klerith/password-property-dto.ts
Password validation - DTO
@IsString()
@MinLength(6)
@MaxLength(50)
@Matches(
/(?:(?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/, {
message: 'The password must have a Uppercase, lowercase letter and a number'
})
password: string;