diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 8e38030da85..01d886e6cab 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -285,7 +285,7 @@ function chunkInvalid(state, chunk) { chunk !== undefined && !state.objectMode) { er = new errors.TypeError('ERR_INVALID_ARG_TYPE', - 'chunk', 'string/Buffer/Uint8Array'); + 'chunk', ['string', 'Buffer', 'Uint8Array']); } return er; } diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index 1735fafb5f3..02481739250 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -252,7 +252,8 @@ function validChunk(stream, state, chunk, cb) { } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new errors.TypeError('ERR_INVALID_ARG_TYPE', 'chunk', 'string/buffer'); + er = new errors.TypeError('ERR_INVALID_ARG_TYPE', 'chunk', + ['string', 'Buffer']); } if (er) { stream.emit('error', er);