Valur(@npm) is an advanced declarative value validator.
Installation:
$ npm install valur --save
Usage:
(see #18)
To validate a value before its use, just preform validation a couple of lines before.
; root8, 3;// 2 (no error) root-8, 3;// NaN (no error, but should be) // *** ; rootValidated-8, 3;// Error: Validation failed: radicand is a negative number: value <number> -8, validator "spectrum"