Closed Steinweber closed 7 years ago
const Contact = thinky.createModel("contact", type.object({
id: type.string().required(),
gender: type.string().required(),
company: type.string(),
firstname: type.string().required(),
lastname: type.string().required()
}).validator(args => {
return !(args.gender === 'company' && args.company.length === 0);
}));
How to validate on top of a model? Like