The raw, unpresented dish is now returned to the app after baking, where it can be retrieved as various different data types.

This commit is contained in:
n1474335 2018-04-21 12:25:48 +01:00
parent 30aa4e05ef
commit 76a066ab74
12 changed files with 163 additions and 73 deletions

View file

@ -17,14 +17,17 @@ class Dish {
/**
* Dish constructor
*
* @param {byteArray|string|number|ArrayBuffer|BigNumber} [value=null]
* - The value of the input data.
* @param {number} [type=Dish.BYTE_ARRAY]
* - The data type of value, see Dish enums.
* @param {Dish} [dish=null] - A dish to clone
*/
constructor(value=null, type=Dish.BYTE_ARRAY) {
this.value = value;
this.type = type;
constructor(dish=null) {
this.value = [];
this.type = Dish.BYTE_ARRAY;
if (dish &&
dish.hasOwnProperty("value") &&
dish.hasOwnProperty("type")) {
this.set(dish.value, dish.type);
}
}