Skip to content

Commit

Permalink
Some lets to consts and removing of trailing spaces from grunt lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jarmovanlenthe committed Dec 14, 2018
1 parent dcff897 commit b4a586c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/core/operations/A1Z26CipherDecode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ class A1Z26CipherDecode extends Operation {
*/
run(input, args) {
const delim = Utils.charRep(args[0] || "Space");

if (input.length === 0) {
return [];
}

let bites = input.split(delim),
latin1 = "";
const bites = input.split(delim);
let latin1 = "";
for (let i = 0; i < bites.length; i++) {
if (bites[i] < 1 || bites[i] > 26) {
throw new OperationError("Error: all numbers must be between 1 and 26.");
Expand Down
4 changes: 2 additions & 2 deletions src/core/operations/A1Z26CipherEncode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ class A1Z26CipherEncode extends Operation {
run(input, args) {
const delim = Utils.charRep(args[0] || "Space");
let output = "";

const sanitizedinput = input.toLowerCase(),
charcode = Utils.strToCharcode(sanitizedinput);

for (let i = 0; i < charcode.length; i++) {
let ordinal = charcode[i] - 96;
const ordinal = charcode[i] - 96;

if (ordinal > 0 && ordinal <= 26) {
output += ordinal.toString(10) + delim;
Expand Down

0 comments on commit b4a586c

Please sign in to comment.