Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bind(ctrl: SfArray) {
let rule = ValidationRules
.ensureObject()
.displayName(ctrl.form.$schema.title)
.satisfies(() => true);
if (ctrl.form.$required) {
rule = rule.required();
}
if (Number.isInteger(ctrl.form.$schema.maxItems)) {
rule = rule.maxItems(ctrl.form.$schema.maxItems);
}
if (Number.isInteger(ctrl.form.$schema.minItems)) {
rule = rule.minItems(ctrl.form.$schema.minItems);
}
if (ctrl.form.$schema.uniqueItems) {
// TODO: add unique items rule
}
rule.on(ctrl.model);
bind(ctrl) {
let rule = ValidationRules
.ensureObject()
.displayName(ctrl.form.$schema.title)
.satisfies(() => true);
if (ctrl.form.$required) {
rule = rule.required();
}
if (Number.isInteger(ctrl.form.$schema.maxItems)) {
rule = rule.maxItems(ctrl.form.$schema.maxItems);
}
if (Number.isInteger(ctrl.form.$schema.minItems)) {
rule = rule.minItems(ctrl.form.$schema.minItems);
}
if (ctrl.form.$schema.uniqueItems) {
// TODO: add unique items rule
}
rule.on(ctrl.model);