mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 23:36:16 -04:00
toggleString args now additionally accept just input value, taking first option as default.
This commit is contained in:
parent
f6c4b5073c
commit
7c9ebafd00
2 changed files with 32 additions and 3 deletions
|
@ -75,9 +75,13 @@ function transformArgs(originalArgs, newArgs) {
|
|||
|
||||
if (index > -1) {
|
||||
const argument = allArgs[index];
|
||||
if (["toggleString"].indexOf(argument.type) > -1) {
|
||||
argument.string = newArgs[key].string;
|
||||
argument.option = newArgs[key].option;
|
||||
if (argument.type === "toggleString") {
|
||||
if (typeof newArgs[key] === "string") {
|
||||
argument.string = newArgs[key];
|
||||
} else {
|
||||
argument.string = newArgs[key].string;
|
||||
argument.option = newArgs[key].option;
|
||||
}
|
||||
} else if (argument.type === "editableOption") {
|
||||
// takes key: "option", key: {name, val: "string"}, key: {name, val: [...]}
|
||||
argument.value = typeof newArgs[key] === "string" ? newArgs[key]: newArgs[key].value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue