login user validation using volder

you can use javascript with power of volder to do validation
volder is schema builder and data validation
visit volder.vercel.app to see more
you can do in this example.

import { Volder, Email } from ‘volder’;

const userSchema = new Volder({
u…


This content originally appeared on DEV Community and was authored by alguerocode

you can use javascript with power of volder to do validation
volder is schema builder and data validation
visit volder.vercel.app to see more
you can do in this example.

import { Volder, Email } from 'volder';


const userSchema = new Volder({
    username: {
        type: [String, 'username must be in string'],
        alphanumeric: [true, 'username should only contain letters and numbers'],
        minLength: [4, 'username at least 4 characters'],
        maxLength: [16, 'username at most 16 characters'],
        required: [true, 'username is required'],
        trim: true
    },
    email: {
        type: [String ,'email must be in string'],
        pattern: [Email, 'not valid email'],
        maxLength: [150, 'email be at most 150 characters'],
        required: [ true,'email is required'],
        trim: true
    },
    password: {
        type: [String , 'password must be in string'],
        minLength:[8, 'password should be at least 8 characters'],
        maxLength: [30, 'password should be at most 30 characters'],
        required: [ true, 'password is required'],
        matches: ["^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]$", 'password must contain numbers and letters']

    }
})

const { valid, errors, value } = userSchema.validate(input);


This content originally appeared on DEV Community and was authored by alguerocode


Print Share Comment Cite Upload Translate Updates
APA

alguerocode | Sciencx (2022-01-30T07:52:55+00:00) login user validation using volder. Retrieved from https://www.scien.cx/2022/01/30/login-user-validation-using-volder/

MLA
" » login user validation using volder." alguerocode | Sciencx - Sunday January 30, 2022, https://www.scien.cx/2022/01/30/login-user-validation-using-volder/
HARVARD
alguerocode | Sciencx Sunday January 30, 2022 » login user validation using volder., viewed ,<https://www.scien.cx/2022/01/30/login-user-validation-using-volder/>
VANCOUVER
alguerocode | Sciencx - » login user validation using volder. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/30/login-user-validation-using-volder/
CHICAGO
" » login user validation using volder." alguerocode | Sciencx - Accessed . https://www.scien.cx/2022/01/30/login-user-validation-using-volder/
IEEE
" » login user validation using volder." alguerocode | Sciencx [Online]. Available: https://www.scien.cx/2022/01/30/login-user-validation-using-volder/. [Accessed: ]
rf:citation
» login user validation using volder | alguerocode | Sciencx | https://www.scien.cx/2022/01/30/login-user-validation-using-volder/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.