Decalarative validator for JS