isomorphic-validation
v0.2.3
Published
Isomorphic javascript form and data validation library.
Downloads
228
Maintainers
Readme
isomorphic-validation
An isomorphic data and form validation javascript library which runs the same code both client and server side and allows for reusing validation logic for the same fields on different forms.
Documentation
Usage examples:
Developing ...
This is a brief outline of the whole library's API:
Validation instance methods
Validation(obj, propName, initVal)
.started(cb)
.valid(cb)
.invalid(cb)
.changed(cb)
.validated(cb)
.error(cb)
.constraint(Predicate()|Function.prototype, { next, debounce, keepValid, optional, ...anyData })
.bind(obj, propName, initVal)
.dataMapper((req, form) => {})
.validate(obj)
Validation instance properties
Validation().constraints
Validation().validations
Validation().isValid
Validation().server // isomorphic API
Validation().client // isomorphic API
Validation().isomorphic // isomorphic API
Validation static methods
Validation.group([Validation(), Validation()])
Validation.glue([Validation(), Validation()])
Validation.clone(Validation())
Validation.profile(selector, [fieldNames], [Validation(), Validation()])
Predicate instance methods
Predicate(() => true|false|Promise{true|false})
.started(cb)
.valid(cb)
.invalid(cb)
.changed(cb)
.validated(cb)
.restored(cb)
.error(cb)
Predicate instance properties
Predicate().server // isomorphic API
Predicate().client // isomorphic API
Predicate().isomorphic // isomorphic API