
Sanitizing Input data is very much required to increase the user experience in any website. We all do small mistakes by sometimes writing our Email with all CAPS ON and even sometimes we put an extra white space in our password which shows errors but NodeJs express-validation gives us special abilities to get rid of that.
How to Sanitize Data in NodeJs?
Just by using .trim() in our router where we can also use our custom designed Validation.
.trim() removes any white space after the input.
.normalizeEmail() gives us the power to make our email letter in small letters. even we write all of them in CAPS On.
Comments