class Validator {
constructor(criterias) {
this.items = criterias.map((item) => ({enabled: true, ...item}));
}
toggleValidate(name, state) {
let item = this.items.find((item) => item.name === name);
if (item) {
item.enabled = typeof state === 'undefined' ? !item.enabled : state;
}
}
validate(value) {
let valid = true;
let errors = new Map();
this.items.forEach((item) => {
if (item.enabled && !item.check(value)) {
valid = false;
errors.set(item.name, item.message(value));
}
});
return {valid, errors};
}
}
message += 'name: ' + data[i].name + ', changedToAt: ' + (data[i].changedToAt || 'своё слово') + '\n';
let onwheel = this.onWheel.bind(this);
SetLength(Forms, 0);
procedure TMainForm.EnterButtonOnClick(Sender: TObject);
var
Forms: array of TForm;
begin
SetLength(Forms, 4);
Forms[0] := RegistrarForm;
Forms[1] := ManagerForm;
Forms[2] := DoctorForm;
Forms[3] := AccountantForm;
Forms[Combobox.ItemIndex].ShowModal();
end;
res.data.data.sort((a, b) => a.place - b.place);
res.data.data.forEach((item) => {
message += item.nickname + ' - Место ' + item.place + '\n';
});
.append($big = $('<img />').attr('src', $this.attr($this.is('img') ? 'data-src' : 'href')).css('position', 'absolute'))