better boolean statement

This commit is contained in:
TheSavageTeddy 2022-11-25 10:59:04 +08:00
parent c79bf5caaf
commit 78d35ecec3
1 changed files with 1 additions and 5 deletions

View File

@ -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;
});