From b0a762157793b0d9143eaa7c270da91932f2a64f Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Sat, 4 Jan 2020 11:24:46 +0100 Subject: [PATCH] util: add todo comments for inspect to add unicode support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/31112 Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell --- lib/internal/util/inspect.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 3f2f75b909663b..21d088c5a9f98b 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -1195,6 +1195,8 @@ function groupArrayElements(ctx, output, value) { if (columns <= 1) { return output; } + // TODO(BridgeAR): Add unicode support. Use the readline getStringWidth + // function. const tmp = []; const maxLineLength = []; for (let i = 0; i < columns; i++) { @@ -1272,6 +1274,8 @@ function formatBigInt(fn, value) { function formatPrimitive(fn, value, ctx) { if (typeof value === 'string') { if (ctx.compact !== true && + // TODO(BridgeAR): Add unicode support. Use the readline getStringWidth + // function. value.length > kMinLineLength && value.length > ctx.breakLength - ctx.indentationLvl - 4) { return value @@ -1617,6 +1621,9 @@ function isBelowBreakLength(ctx, output, start, base) { // Each entry is separated by at least a comma. Thus, we start with a total // length of at least `output.length`. In addition, some cases have a // whitespace in-between each other that is added to the total as well. + // TODO(BridgeAR): Add unicode support. Use the readline getStringWidth + // function. Check the performance overhead and make it an opt-in in case it's + // significant. let totalLength = output.length + start; if (totalLength + output.length > ctx.breakLength) return false;