UNPKG

idea-toolbox

Version:
22 lines (21 loc) 932 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Check = void 0; const resource_model_1 = require("./resource.model"); class Check extends resource_model_1.Resource { load(x) { if (x) x = typeof x === 'object' ? x : { value: x }; // backward compatibility super.load(x); this.value = this.clean(x.value, v => (typeof v === 'number' ? Number(v) : String(v))); this.name = x.name ? this.clean(x.name, String) : String(this.value); this.checked = this.clean(x.checked, Boolean); this.hidden = this.clean(x.hidden, Boolean); this.avatar = this.clean(x.avatar, String); this.color = this.clean(x.color, String); this.description = this.clean(x.description, String); this.category1 = this.clean(x.category1, String); this.category2 = this.clean(x.category2, String); } } exports.Check = Check;