From bf2b57e46f4fc876c7079f61ca9d614c90766d7a Mon Sep 17 00:00:00 2001 From: dnlup Date: Tue, 19 Mar 2019 15:04:38 +0100 Subject: [PATCH] lib: remove usage of require('util') Remove the usage of `require('util').inspect`. PR-URL: https://github.com/nodejs/node/pull/26779 Refs: https://github.com/nodejs/node/issues/26546 Reviewed-By: Ruben Bridgewater Reviewed-By: Yongsheng Zhang --- lib/internal/encoding.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js index 92a50952516536..33cfcf9d53a4c4 100644 --- a/lib/internal/encoding.js +++ b/lib/internal/encoding.js @@ -327,7 +327,7 @@ class TextEncoder { }); obj.encoding = this.encoding; // Lazy to avoid circular dependency - return require('util').inspect(obj, opts); + return require('internal/util/inspect').inspect(obj, opts); } } @@ -528,7 +528,7 @@ function makeTextDecoderJS() { obj[kHandle] = this[kHandle]; } // Lazy to avoid circular dependency - return require('util').inspect(obj, opts); + return require('internal/util/inspect').inspect(obj, opts); } })); Object.defineProperties(TextDecoder.prototype, {