class APIFilter // This holds ONE filter element { constructor(data, type) { this.Set(data, type); } Get() { return {and: this.and, field: this.field, op: this.op, value: this.value}; } Set(data, type) { this.and = typeof(data.and)!="undefined" ? data.and : "and"; this.field = typeof(data.field)!="undefined" ? data.field : "none"; this.op = typeof(data.op)!="undefined" ? data.op : ""; this.value = typeof(data.value)!="undefined" ? data.value : ("Multiple"==type ? [] : ""); } }