Skip to content

Commit

Permalink
hadash: banish evil eval
Browse files Browse the repository at this point in the history
  • Loading branch information
flaparoo committed Sep 13, 2024
1 parent 8113cbb commit a6bf396
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/hadash/hadash.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ function getServiceInputData(entry, level) {
if (idx == -1) {
idx = entry.input[key].options.push(entry.input[key].value) - 1;
}
// the setTimeout method can not be used for the "format" CB since it expects a return value - using eval instead:
eval('CBs["'+key+'_format"] = function(v) { return entry.input["'+key+'"].options[v]; }');
// the setTimeout method can not be used for the "format" CB since it expects a return value:
CBs[`${key}_format`] = ((key) => function(v) { return entry.input[key].options[v]; })(key);
serviceInputMenu[label] = {
value: parseInt(idx),
min: 0,
Expand Down

0 comments on commit a6bf396

Please sign in to comment.