Skip to content

Commit

Permalink
crypto: use validateObject
Browse files Browse the repository at this point in the history
The `validateObject()` validator can be used to cleanup validation and
keep consistency.
  • Loading branch information
VoltrexKeyva committed Aug 24, 2021
1 parent 0d88c14 commit daffa46
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/internal/crypto/keys.js
Original file line number Diff line number Diff line change
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 daffa46

Please sign in to comment.