Skip to content

Commit

Permalink
Use Buffer.isBuffer instead of instanceof (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbking committed Feb 24, 2020
1 parent f2b5ee3 commit 28def30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/verify.js
Expand Up @@ -51,7 +51,7 @@ module.exports = {
*/
verifyHMAC: function verifyHMAC(parsedSignature, secret) {
assert.object(parsedSignature, 'parsedHMAC');
assert(typeof (secret) === 'string' || secret instanceof Buffer);
assert(typeof (secret) === 'string' || Buffer.isBuffer(secret));

var alg = validateAlgorithm(parsedSignature.algorithm);
if (alg[0] !== 'hmac')
Expand Down

0 comments on commit 28def30

Please sign in to comment.