From fd00ae0819e654e806565b60b33f06d82fcdb2b3 Mon Sep 17 00:00:00 2001 From: Jonathan Lai Date: Tue, 4 Oct 2022 11:13:41 -0400 Subject: [PATCH] reverted bcrypt.js changes --- bcrypt.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bcrypt.js b/bcrypt.js index dd8aed06..7fc281c4 100644 --- a/bcrypt.js +++ b/bcrypt.js @@ -87,14 +87,10 @@ module.exports.genSalt = function genSalt(rounds, minor, cb) { /// @param {String} salt the salt to use when hashing /// @return {String} hash module.exports.hashSync = function hashSync(data, salt) { - if (data == null || salt == null) { throw new Error('data and salt arguments required'); } - - if (salt === '') { - throw new Error('Salt cannot be empty'); - } + if (typeof data !== 'string' || (typeof salt !== 'string' && typeof salt !== 'number')) { throw new Error('data must be a string and salt must either be a salt string or a number of rounds'); }