blockly-fluid 1.4.28 → 1.4.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +8 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -200,14 +200,17 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
|
|
|
200
200
|
if ((typeof next === "function") ? next() : next) this.setNextStatement(true, null);
|
|
201
201
|
} else {
|
|
202
202
|
if (output === "Color") (output = "Colour");
|
|
203
|
-
if ((typeof output === "function") && ![String, Number, Boolean, Array, Object].includes(output))
|
|
204
|
-
output = output();
|
|
205
|
-
console.log(output, [String, Number, Boolean, Array, Object].includes(output));
|
|
206
|
-
};
|
|
203
|
+
if ((typeof output === "function") && !["String", "Number", "Boolean", "Array", "Object"].includes(output.name)) (output = output());
|
|
207
204
|
|
|
208
205
|
this.setPreviousStatement(false);
|
|
209
206
|
this.setNextStatement(false);
|
|
210
|
-
|
|
207
|
+
|
|
208
|
+
this.setOutput(true, (output === true) ? null : ((["String", "Number", "Boolean", "Array", "Object"].includes(output?.name)) ? output.name : ((Array.isArray(output)) ? output.map((type) => {
|
|
209
|
+
if (type === "Color") (type = "Colour");
|
|
210
|
+
if ((typeof type === "function") && !["String", "Number", "Boolean", "Array", "Object"].includes(type.name)) (type = type());
|
|
211
|
+
|
|
212
|
+
return (["String", "Number", "Boolean", "Array", "Object"].includes(type?.name)) ? type.name : type;
|
|
213
|
+
}) : output)));
|
|
211
214
|
};
|
|
212
215
|
|
|
213
216
|
this.setColour(color);
|