Chaining validators for javascript