hadash: banish evil eval

pull/3558/head
Flaparoo 2024-09-13 20:50:07 +08:00
parent 8113cbba4d
commit a6bf39620e
1 changed files with 2 additions and 2 deletions

View File

@ -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,