Skip to content

Commit a0b1a06

Browse files
BridgeARtargos
authored andcommitted
util: add todo comments for inspect to add unicode support
PR-URL: #31112 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 5e5d053 commit a0b1a06

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/internal/util/inspect.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,8 @@ function groupArrayElements(ctx, output, value) {
12061206
if (columns <= 1) {
12071207
return output;
12081208
}
1209+
// TODO(BridgeAR): Add unicode support. Use the readline getStringWidth
1210+
// function.
12091211
const tmp = [];
12101212
const maxLineLength = [];
12111213
for (let i = 0; i < columns; i++) {
@@ -1283,6 +1285,8 @@ function formatBigInt(fn, value) {
12831285
function formatPrimitive(fn, value, ctx) {
12841286
if (typeof value === 'string') {
12851287
if (ctx.compact !== true &&
1288+
// TODO(BridgeAR): Add unicode support. Use the readline getStringWidth
1289+
// function.
12861290
value.length > kMinLineLength &&
12871291
value.length > ctx.breakLength - ctx.indentationLvl - 4) {
12881292
return value
@@ -1636,6 +1640,9 @@ function isBelowBreakLength(ctx, output, start, base) {
16361640
// Each entry is separated by at least a comma. Thus, we start with a total
16371641
// length of at least `output.length`. In addition, some cases have a
16381642
// whitespace in-between each other that is added to the total as well.
1643+
// TODO(BridgeAR): Add unicode support. Use the readline getStringWidth
1644+
// function. Check the performance overhead and make it an opt-in in case it's
1645+
// significant.
16391646
let totalLength = output.length + start;
16401647
if (totalLength + output.length > ctx.breakLength)
16411648
return false;

0 commit comments

Comments
 (0)