Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
crypto: use validateObject
The `validateObject()` validator can be used to cleanup validation and
keep consistency.

PR-URL: #39872
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
VoltrexKeyva authored and BethGriggs committed Sep 21, 2021
1 parent 59fff92 commit d80082f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/internal/crypto/keys.js
Expand Up @@ -299,8 +299,7 @@ function isStringOrBuffer(val) {
}

function parseKeyEncoding(enc, keyType, isPublic, objName) {
if (enc === null || typeof enc !== 'object')
throw new ERR_INVALID_ARG_TYPE('options', 'object', enc);
validateObject(enc, 'options');

const isInput = keyType === undefined;

Expand Down

0 comments on commit d80082f

Please sign in to comment.