Skip to content

Commit 4c64ecb

Browse files
committed
refactor: renaming to currentDirection
1 parent b6e22e7 commit 4c64ecb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/rules/sequentialChars.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ function assert(options, password) {
5959

6060
let prevCode = password.charCodeAt(0);
6161
let seqLen = isAlphanumeric(prevCode) ? 1 : 0;
62-
let direction = Direction.None;
62+
let currentDirection = Direction.None;
6363

6464
for (let i = 1; i < password.length; i++) {
6565
const currentCode = password.charCodeAt(i);
6666
if (!isAlphanumeric(currentCode) || !isAlphanumeric(prevCode)) {
67-
direction = Direction.None;
67+
currentDirection = Direction.None;
6868
seqLen = 1;
6969
prevCode = currentCode;
7070
continue;
@@ -74,15 +74,15 @@ function assert(options, password) {
7474
prevCode = currentCode;
7575

7676
if (diff === Direction.Ascending || diff === Direction.Descending) {
77-
if (direction === diff) {
77+
if (currentDirection === diff) {
7878
seqLen += 1;
7979
} else {
8080
// start a new potential sequence of length 2 (prev + current)
81-
direction = diff;
81+
currentDirection = diff;
8282
seqLen = 2;
8383
}
8484
} else {
85-
direction = Direction.None;
85+
currentDirection = Direction.None;
8686
seqLen = 1;
8787
}
8888

0 commit comments

Comments
 (0)