mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Added more error-handling to ToUpperCase()
This commit is contained in:
parent
2574a63975
commit
ed542582f9
1 changed files with 3 additions and 0 deletions
|
@ -37,6 +37,9 @@ class ToUpperCase extends Operation {
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
|
if (!args || args.length === 0) {
|
||||||
|
throw new OperationException("No capitalization scope was provided.");
|
||||||
|
}
|
||||||
const scope = args[0];
|
const scope = args[0];
|
||||||
if (scope === "All") {
|
if (scope === "All") {
|
||||||
return input.toUpperCase();
|
return input.toUpperCase();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue