Skip to content

Commit b0a7621

Browse files
committed
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 84c3b87 commit b0a7621

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
@@ -1195,6 +1195,8 @@ function groupArrayElements(ctx, output, value) {
11951195
if (columns <= 1) {
11961196
return output;
11971197
}
1198+
// TODO(BridgeAR): Add unicode support. Use the readline getStringWidth
1199+
// function.
11981200
const tmp = [];
11991201
const maxLineLength = [];
12001202
for (let i = 0; i < columns; i++) {
@@ -1272,6 +1274,8 @@ function formatBigInt(fn, value) {
12721274
function formatPrimitive(fn, value, ctx) {
12731275
if (typeof value === 'string') {
12741276
if (ctx.compact !== true &&
1277+
// TODO(BridgeAR): Add unicode support. Use the readline getStringWidth
1278+
// function.
12751279
value.length > kMinLineLength &&
12761280
value.length > ctx.breakLength - ctx.indentationLvl - 4) {
12771281
return value
@@ -1617,6 +1621,9 @@ function isBelowBreakLength(ctx, output, start, base) {
16171621
// Each entry is separated by at least a comma. Thus, we start with a total
16181622
// length of at least `output.length`. In addition, some cases have a
16191623
// whitespace in-between each other that is added to the total as well.
1624+
// TODO(BridgeAR): Add unicode support. Use the readline getStringWidth
1625+
// function. Check the performance overhead and make it an opt-in in case it's
1626+
// significant.
16201627
let totalLength = output.length + start;
16211628
if (totalLength + output.length > ctx.breakLength)
16221629
return false;

0 commit comments

Comments
 (0)