Skip to content

Commit 7dabd03

Browse files
committed
Minor code fixes
1 parent 4ab7a5e commit 7dabd03

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/helpers/radixTree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class RadixTree {
2323
}
2424

2525
searchForNodes(word) {
26+
let found = false;
2627
const iterObject = (nodes, initialValue) => {
2728
return Object.keys(nodes).reduce((r, key) => {
2829
if (key === 'isword' && r === word) {
@@ -33,7 +34,6 @@ class RadixTree {
3334
}, initialValue);
3435
}
3536

36-
let found = false;
3737
iterObject(this.nodes, '');
3838
return found;
3939
}

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const isStupid = (userPasswordInputString) => {
1010
const userHashedPassword = crypto.createHash('sha1').update(userPassword).digest('hex');
1111

1212
return passwordTree.searchForNodes(userHashedPassword);
13-
}
13+
};
1414

1515
exports.isStupid = isStupid;
1616
exports.isOneOfThem = isStupid;
@@ -33,4 +33,4 @@ exports.rateOfUsage = (userPasswordInputString) => {
3333
frequency: 0,
3434
message: 'The password is not part of the list'
3535
};
36-
}
36+
};

0 commit comments

Comments
 (0)