From 2cde79b206477409fbe38189e3346aebd885afee Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 6 Sep 2019 19:18:24 +0200 Subject: [PATCH] Partially revert "stream: reduce internal usage of public require of util" This partially reverts commit c97851dcd8c5e96a3601df52edd456922399a80b. Streams code should ideally require on public APIs as much as possible, because it is exported as readable-stream. Refs: https://github.com/nodejs/node/pull/26698 Refs: https://github.com/nodejs/readable-stream/issues/416 --- lib/internal/streams/buffer_list.js | 2 +- lib/stream.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/streams/buffer_list.js b/lib/internal/streams/buffer_list.js index 715d5d201d4df4..234ffbe51b3a52 100644 --- a/lib/internal/streams/buffer_list.js +++ b/lib/internal/streams/buffer_list.js @@ -1,7 +1,7 @@ 'use strict'; const { Buffer } = require('buffer'); -const { inspect } = require('internal/util/inspect'); +const { inspect } = require('util'); module.exports = class BufferList { constructor() { diff --git a/lib/stream.js b/lib/stream.js index 4918434167c535..e6c59e2483410b 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -45,7 +45,7 @@ Stream.Stream = Stream; // Internal utilities try { - const types = require('internal/util/types'); + const types = require('util').types; if (types && typeof types.isUint8Array === 'function') { Stream._isUint8Array = types.isUint8Array; } else {