diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js index 6cb840e9d1e84f..befc4f811b2dde 100644 --- a/lib/internal/encoding.js +++ b/lib/internal/encoding.js @@ -31,7 +31,7 @@ const { } = require('internal/util'); const { - isArrayBuffer, + isAnyArrayBuffer, isArrayBufferView, isUint8Array } = require('internal/util/types'); @@ -404,7 +404,7 @@ function makeTextDecoderICU() { decode(input = empty, options = {}) { validateDecoder(this); - if (isArrayBuffer(input)) { + if (isAnyArrayBuffer(input)) { input = lazyBuffer().from(input); } else if (!isArrayBufferView(input)) { throw new ERR_INVALID_ARG_TYPE('input', @@ -469,7 +469,7 @@ function makeTextDecoderJS() { decode(input = empty, options = {}) { validateDecoder(this); - if (isArrayBuffer(input)) { + if (isAnyArrayBuffer(input)) { input = lazyBuffer().from(input); } else if (isArrayBufferView(input)) { input = lazyBuffer().from(input.buffer, input.byteOffset,