mirror of
https://github.com/gchq/CyberChef
synced 2025-12-10 13:23:25 +00:00
toggleString args now additionally accept just input value, taking first option as default.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user