Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
crypto: use validateObject
The `validateObject()` validator can be used to cleanup validation and
keep consistency.
  • Loading branch information
VoltrexKeyva committed Aug 24, 2021
commit daffa4671c77d2eef2fff9548f5472ff9f941073
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