summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirk Skyum <74932975+birkskyum@users.noreply.github.com>2024-08-08 12:20:16 +0200
committerGitHub <noreply@github.com>2024-08-08 15:50:16 +0530
commit733162a83eb0808d593ceadbf15bb3490cc1aa15 (patch)
tree1f54691d8b6606602d1dceaec85d977fd6569e5b
parent6fce23c54ec619168eee096fc7bf801d0cec0cb6 (diff)
fix(node/crypto): Assign publicKey and privateKey with let instead of const (#24943)
Because public/private key are reassigned, they should be `let` instead of `const`. Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
-rw-r--r--ext/node/polyfills/internal/crypto/keygen.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/node/polyfills/internal/crypto/keygen.ts b/ext/node/polyfills/internal/crypto/keygen.ts
index 4e2543cd9..a40c76c0d 100644
--- a/ext/node/polyfills/internal/crypto/keygen.ts
+++ b/ext/node/polyfills/internal/crypto/keygen.ts
@@ -573,8 +573,8 @@ export function generateKeyPair(
const privateKeyHandle = op_node_get_private_key_from_pair(pair);
const publicKeyHandle = op_node_get_public_key_from_pair(pair);
- const privateKey = new PrivateKeyObject(privateKeyHandle);
- const publicKey = new PublicKeyObject(publicKeyHandle);
+ let privateKey = new PrivateKeyObject(privateKeyHandle);
+ let publicKey = new PublicKeyObject(publicKeyHandle);
if (typeof options === "object" && options !== null) {
const { publicKeyEncoding, privateKeyEncoding } = options as any;