Exporing options with API.

This commit is contained in:
d98762625 2018-04-13 12:14:40 +01:00
parent 30aa4e05ef
commit 59877b5138
5 changed files with 149 additions and 17 deletions

View file

@ -240,6 +240,26 @@ class Dish {
}
}
/**
*
*/
findType() {
if (!this.value) {
throw "Dish has no value";
}
const types = [Dish.BYTE_ARRAY, Dish.STRING, Dish.HTML, Dish.NUMBER, Dish.ARRAY_BUFFER, Dish.BIG_NUMBER, Dish.LIST_FILE];
types.find((type) => {
this.type = type;
if (this.valid()) {
return true;
}
});
return this.type;
}
/**
* Determines how much space the Dish takes up.