Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d80082f

Browse filesBrowse files
VoltrexKeyvaBethGriggs
authored andcommitted
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>
1 parent 59fff92 commit d80082f
Copy full SHA for d80082f

File tree

Expand file treeCollapse file tree

1 file changed

+1
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-2
lines changed
Open diff view settings
Collapse file

‎lib/internal/crypto/keys.js‎

Copy file name to clipboardExpand all lines: lib/internal/crypto/keys.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,7 @@ function isStringOrBuffer(val) {
299299
}
300300

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

305304
const isInput = keyType === undefined;
306305

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.