diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2024-09-11 19:24:17 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-11 19:24:17 +0900 |
commit | aae3a6bcb41fdb305d61a95f176be0db1513c56e (patch) | |
tree | bd181542cf2f5b608ce0ed25bb9d3228b2a71644 /ext/node/polyfills/internal/crypto | |
parent | 200145a09a51e96298f1ecd5ce78f75c27c7880a (diff) |
fix(ext/node): fix `Cipheriv#update(string, undefined)` (#25571)
Diffstat (limited to 'ext/node/polyfills/internal/crypto')
-rw-r--r-- | ext/node/polyfills/internal/crypto/cipher.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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); } |