diff options
Diffstat (limited to 'ext/node/polyfills')
-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); } |