Declarative JavaScript object validation