typs
An handy library for type validation in Javascript
Just
npm install typs --save
it.
The library is still widely open to changes, so feel free to propose new features or open an issue.
What can I use it for?
Param checking
Write a sound REST API or provide strong code constraints validating your parameters
app;
Input validation
Let typs handle your validation logic in an easy and semantic way
const usernameType = ;const uniqueUsernameType = usernameType;const passwordType = ;const emailType = ; { if throw 'the username you provided is not a valid username' if throw 'the password you provided is not valid'; if throw 'the e-mail you provided is not valid'; ;}
License
Typs comes with a good, ol' MIT license.