mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Made replacing the text optional
This commit is contained in:
parent
e8fb73ca6c
commit
479bb609f5
1 changed files with 11 additions and 6 deletions
|
@ -19,7 +19,7 @@ class Print extends Operation {
|
||||||
|
|
||||||
this.name = "Print";
|
this.name = "Print";
|
||||||
this.module = "Other";
|
this.module = "Other";
|
||||||
this.description = "Prints a register";
|
this.description = "Prints a text to the output.";
|
||||||
this.infoURL = ""; // Usually a Wikipedia link. Remember to remove localisation (i.e. https://wikipedia.org/etc rather than https://en.wikipedia.org/etc)
|
this.infoURL = ""; // Usually a Wikipedia link. Remember to remove localisation (i.e. https://wikipedia.org/etc rather than https://en.wikipedia.org/etc)
|
||||||
this.inputType = "string";
|
this.inputType = "string";
|
||||||
this.outputType = "string";
|
this.outputType = "string";
|
||||||
|
@ -28,6 +28,11 @@ class Print extends Operation {
|
||||||
name: "Text to print",
|
name: "Text to print",
|
||||||
type: "string",
|
type: "string",
|
||||||
value: ""
|
value: ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Replace",
|
||||||
|
type: "boolean",
|
||||||
|
value: true
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -38,11 +43,11 @@ class Print extends Operation {
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
console.log(args);
|
const [text, replace] = args;
|
||||||
|
if (replace) {
|
||||||
//input = args[0].value;
|
return text.toString();
|
||||||
//return input;
|
}
|
||||||
return args[0].toString();
|
return input + text.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue