1.0.8 • Published 4 years ago

class-validator-password-check v1.0.8

Weekly downloads
78
License
ISC
Repository
github
Last release
4 years ago

class-validator-password-check

Password Validator using class-validator

Installation

Module installation

$ npm install class-validator-password-check --save
$ yarn add class-validator-password-check

(or the short way):

npm i -S class-transformer-validator

Peer dependencies

This package is only a simple plugin/wrapper, so you have to install the required modules too because it can't work without them. See detailed installation instruction for the modules installation:

import { PasswordValidation, PasswordValidationRequirement } from 'class-validator-password-check'

var passwordRequirement: PasswordValidationRequirement = {
    mustContainLowerLetter: true,
    mustContainNumber: true,
    mustContainSpecialCharacter: true,
    mustContainUpperLetter: true
}

export class UserRegisterDto {

    @IsString()
    @MinLength(6)
    @MaxLength(20)
    @Validate(PasswordValidation, [passwordRequirement])
    readonly password: string;
    
}

Todos

  • Add minimium length
  • Make special character dynamic

License

MIT

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago