You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.
Hi. I've found express-form very useful, but only for express applications. For plain objects I can use https://www.npmjs.org/package/node-validator, but it didn't use validator package, which isn't nice. I think express-form can be easily refactored into 2 packages. First one is about data validation (with chaining and all cool stuff), and the second one is about express middleware specific. Here are some thoughts:
Object validation
// create validator bundlevarv=validator(validator.property('name').trim().toString().requred(),// alias for form.field// other routines);// perform data validationv.run(objectToValidate,function(err,data){// err - validation errors (same as in the middleware) or null// data - sanitized objectToValidate});
Express middleware
form factory for middleware will just delegate all validation specific logic to the validation module.
Any thoughts?
The text was updated successfully, but these errors were encountered:
maxmalov
changed the title
Extract data validation logic to a separate module
Move data validation logic to a separate module
Sep 13, 2014
Hi. I've found
express-form
very useful, but only for express applications. For plain objects I can use https://www.npmjs.org/package/node-validator, but it didn't usevalidator
package, which isn't nice. I thinkexpress-form
can be easily refactored into 2 packages. First one is about data validation (with chaining and all cool stuff), and the second one is about express middleware specific. Here are some thoughts:Object validation
Express middleware
form
factory for middleware will just delegate all validation specific logic to the validation module.Any thoughts?
The text was updated successfully, but these errors were encountered: