mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 06:55:08 -04:00
fix: use defaultIndex instead of 0 in transformArgs
This commit is contained in:
parent
7c8be12d52
commit
b9ed1fde62
1 changed files with 2 additions and 2 deletions
|
@ -74,11 +74,11 @@ function transformArgs(opArgsList, newArgs) {
|
|||
return opArgs.map((arg) => {
|
||||
if (arg.type === "option") {
|
||||
// pick default option if not already chosen
|
||||
return typeof arg.value === "string" ? arg.value : arg.value[0];
|
||||
return typeof arg.value === "string" ? arg.value : arg.value[arg.defaultIndex ?? 0];
|
||||
}
|
||||
|
||||
if (arg.type === "editableOption") {
|
||||
return typeof arg.value === "string" ? arg.value : arg.value[0].value;
|
||||
return typeof arg.value === "string" ? arg.value : arg.value[arg.defaultIndex ?? 0].value;
|
||||
}
|
||||
|
||||
if (arg.type === "toggleString") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue