Would be nice if duns schemas could have conditional validations, like this
var schema = Duns.object.keys({
age : Duns.number().min(0).condition(
'above18',
Duns.number().min(18)
)
})
if (schema.validate() === false) return;
var str = schema.validate('above18') ? 'Above 18' : 'No more than 18';
With this functionality you can easily remove a lot of nested conditional validation, by creating more complex schemas.
Would be nice if duns schemas could have conditional validations, like this
With this functionality you can easily remove a lot of nested conditional validation, by creating more complex schemas.