verdict.js
Javascript condition evaluator.
Rewritten from the ground up from the original verdict, cleaner interface inspired from ruler by Garrett Johnson. Adds nesting and "any" vs "all" composite capabilities. Browser-friendly. The segmentation tree capabilities have been dropped and may be available in a separate module with this as a dependency, but are not baked in. For now.
Installation
npm install verdict.js
Usage
There are two main ways to use verdict. The first is a fluent interface:
var assert = ;var verdict = ;var res = ;;
Rulesets are implicitly assumed to use the "all" composite handler, aka all must be true. That's easy to change:
var res = ;;
You can also make more complex, nested rulesets as necessary:
var res = all all ; ;
The second way to use verdict is to pass a plain javascript object, and you will receive a valid ruleset object back:
var ruleset = ;
See test/**/*.js for more examples, and see lib/comparison/index.js for all available comparison functions.
License
MIT license, do very bad things