mirror of
https://github.com/gchq/CyberChef
synced 2025-12-05 23:53:27 +00:00
Merge pull request #2015 from bartvanandel/fix/use-default-index-in-option-transform
This commit is contained in:
@@ -74,11 +74,11 @@ function transformArgs(opArgsList, newArgs) {
|
|||||||
return opArgs.map((arg) => {
|
return opArgs.map((arg) => {
|
||||||
if (arg.type === "option") {
|
if (arg.type === "option") {
|
||||||
// pick default option if not already chosen
|
// 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") {
|
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") {
|
if (arg.type === "toggleString") {
|
||||||
|
|||||||
Reference in New Issue
Block a user