Skip to content

Commit dcdbdc8

Browse files
committed
Fix code style issues using Prettier
1 parent fbcc54c commit dcdbdc8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Ciphers/RailFenceCipher.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
function railFenceCipher(text, rails) {
2-
if (rails <= 1) return text;
2+
if (rails <= 1) return text
33

4-
const fence = Array.from({ length: rails }, () => []);
5-
let rail = 0;
6-
let direction = 1;
4+
const fence = Array.from({ length: rails }, () => [])
5+
let rail = 0
6+
let direction = 1
77

88
for (const char of text) {
9-
fence[rail].push(char);
10-
rail += direction;
9+
fence[rail].push(char)
10+
rail += direction
1111

1212
if (rail === 0 || rail === rails - 1) {
13-
direction *= -1;
13+
direction *= -1
1414
}
1515
}
1616

17-
return fence.flat().join('');
17+
return fence.flat().join('')
1818
}
1919

20-
module.exports = railFenceCipher;
20+
module.exports = railFenceCipher

0 commit comments

Comments
 (0)