From dc894df5f4f87cec3a893ec4bc500956c2cdaa98 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 18 Dec 2023 20:45:04 -0500 Subject: [PATCH] don't omit function params that evaluate to false (like 0) --- views/main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/views/main.js b/views/main.js index 41908bf..bdd54ba 100644 --- a/views/main.js +++ b/views/main.js @@ -32,7 +32,13 @@ function exampleTabView (state, emit) { let functionName; if (obj.inputs !== undefined) { - functionName = `${obj.name}( ${obj.inputs.map((input) => `${input.name}${input.default ? ` = ${input.default}`: ''}`).join(', ')} )` + let params = obj.inputs.map((input) => + input.default === undefined + ? input.name + : `${input.name}=${input.default}` + ); + params = params.join(', '); + functionName = `${obj.name}( ${params} )` } else { if (obj.default !== undefined) {