mirror of
https://github.com/gchq/CyberChef
synced 2025-01-01 07:18:47 +00:00
better boolean statement
This commit is contained in:
parent
c79bf5caaf
commit
78d35ecec3
1 changed files with 1 additions and 5 deletions
|
@ -113,12 +113,8 @@ class FromBase85 extends Operation {
|
|||
.split("")
|
||||
.map((chr, idx) => {
|
||||
const digit = alphabet.indexOf(chr);
|
||||
if (digit < 0 || digit > 84) {
|
||||
if (chr === "z") {
|
||||
// Pass (Ignore character)
|
||||
} else {
|
||||
if ((digit < 0 || digit > 84) && chr !== "z") {
|
||||
throw `Invalid character '${chr}' at index ${i + idx}`;
|
||||
}
|
||||
}
|
||||
return digit;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue