From aae3a6bcb41fdb305d61a95f176be0db1513c56e Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 11 Sep 2024 19:24:17 +0900 Subject: fix(ext/node): fix `Cipheriv#update(string, undefined)` (#25571) --- ext/node/polyfills/internal/crypto/cipher.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/node/polyfills/internal/crypto/cipher.ts') diff --git a/ext/node/polyfills/internal/crypto/cipher.ts b/ext/node/polyfills/internal/crypto/cipher.ts index 2141edc76..a1449cd87 100644 --- a/ext/node/polyfills/internal/crypto/cipher.ts +++ b/ext/node/polyfills/internal/crypto/cipher.ts @@ -242,7 +242,7 @@ export class Cipheriv extends Transform implements Cipher { ): Buffer | string { // TODO(kt3k): throw ERR_INVALID_ARG_TYPE if data is not string, Buffer, or ArrayBufferView let buf = data; - if (typeof data === "string" && typeof inputEncoding === "string") { + if (typeof data === "string") { buf = Buffer.from(data, inputEncoding); } @@ -396,7 +396,7 @@ export class Decipheriv extends Transform implements Cipher { ): Buffer | string { // TODO(kt3k): throw ERR_INVALID_ARG_TYPE if data is not string, Buffer, or ArrayBufferView let buf = data; - if (typeof data === "string" && typeof inputEncoding === "string") { + if (typeof data === "string") { buf = Buffer.from(data, inputEncoding); } -- cgit v1.2.3