We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c819d6 commit 42aca13Copy full SHA for 42aca13
lib/internal/crypto/keygen.js
@@ -94,13 +94,15 @@ function generateKeyPairSync(type, options) {
94
}
95
96
function handleError(ret) {
97
- if (ret === undefined)
+ if (ret == null)
98
return; // async
99
100
- const [err, [publicKey, privateKey]] = ret;
+ const [err, keys] = ret;
101
if (err !== undefined)
102
throw err;
103
104
+ const [publicKey, privateKey] = keys;
105
+
106
// If no encoding was chosen, return key objects instead.
107
return {
108
publicKey: wrapKey(publicKey, PublicKeyObject),
0 commit comments