idea-toolbox
Version:
IDEA's utility functions
25 lines (24 loc) • 752 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Contacts = void 0;
const resource_model_1 = require("./resource.model");
class Contacts extends resource_model_1.Resource {
load(x) {
super.load(x);
if (x.phone)
this.phone = this.clean(x.phone, String);
if (x.email)
this.email = this.clean(x.email, String);
if (x.name)
this.name = this.clean(x.name, String);
}
validate() {
const e = super.validate();
if (this.phone && this.iE(this.phone, 'phone'))
e.push('phone');
if (this.email && this.iE(this.email, 'email'))
e.push('email');
return e;
}
}
exports.Contacts = Contacts;