chain-validator
Chainable Object Types Validator
Usage
// ES6; const validator = name: TstringisRequired age: TintegerisRequired birthday: Tdate callback: Tfunction info: Tobject liked: Tarray test: Tregex brand: Tsymbol latitude: Tfloatgreedy longitude: Tdouble // alias of float; const data = name: 'Chia Yu Pai' age: 26 birthday: '1990/02/08' info: bio: 'hello world' liked: 'apple' 'linux' test: /t/i brand: Symbol'Apple Inc.' latitude: '22.19009' longitude: 122457; validator; if validator // Pass else // Invalid
To-Do
- shape check
- unit test case