Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simplify check for valid callback

code cleanup
  • Loading branch information...
commit dac1ca1d1a6a41407144037b308ebb134c5f63d4 1 parent ab1a156
@defunctzombie defunctzombie authored
Showing with 2 additions and 6 deletions.
  1. +2 −6 bcrypt.js
View
8 bcrypt.js
@@ -120,9 +120,7 @@ module.exports.hash = function(data, salt, cb) {
return cb(new Error('data must be a string and salt must either be a salt string or a number of rounds'));
}
- if (!cb) {
- return;
- } else if (typeof cb !== 'function') {
+ if (!cb || typeof cb !== 'function') {
return;
}
@@ -166,9 +164,7 @@ module.exports.compare = function(data, hash, cb) {
return cb(new Error('data and hash must be strings'));
}
- if (!cb) {
- return;
- } else if (typeof cb !== 'function') {
+ if (!cb || typeof cb !== 'function') {
return;
}
Please sign in to comment.
Something went wrong with that request. Please try again.