Remove Item class and its associated methods

This commit is contained in:
HoshinoKoji 2025-03-04 21:24:21 +08:00
parent c5741c2fc1
commit ecade0cd3e

View File

@ -1,28 +0,0 @@
class Item {
static get TYPES() {
return ["text", "radio", "checkbox", "scale"];
}
constructor({type, title, optTexts, optValues = null}) {
this._title = title;
this._type = type;
this._texts = optTexts;
this._values = optValues;
this._response = null;
}
static isValid({type, title, optTexts, optValues = null}) {
if (!title || !Item.TYPES.includes(type)) {
return false;
}
if (type === "text") {
return true;
}
if (optTexts && optValues && optTexts.length !== optValues.length) {
return false;
}
return true;
}
}
export default Item;