Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 63f4eae

Browse filesBrowse files
BridgeARMylesBorins
authored andcommitted
util: add todo comments for inspect to add unicode support
PR-URL: #31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3c82d5b commit 63f4eae
Copy full SHA for 63f4eae

File tree

Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Open diff view settings
Collapse file

‎lib/internal/util/inspect.js‎

Copy file name to clipboardExpand all lines: lib/internal/util/inspect.js
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,8 @@ function groupArrayElements(ctx, output, value) {
11901190
if (columns <= 1) {
11911191
return output;
11921192
}
1193+
// TODO(BridgeAR): Add unicode support. Use the readline getStringWidth
1194+
// function.
11931195
const tmp = [];
11941196
const maxLineLength = [];
11951197
for (let i = 0; i < columns; i++) {
@@ -1267,6 +1269,8 @@ function formatBigInt(fn, value) {
12671269
function formatPrimitive(fn, value, ctx) {
12681270
if (typeof value === 'string') {
12691271
if (ctx.compact !== true &&
1272+
// TODO(BridgeAR): Add unicode support. Use the readline getStringWidth
1273+
// function.
12701274
value.length > kMinLineLength &&
12711275
value.length > ctx.breakLength - ctx.indentationLvl - 4) {
12721276
return value
@@ -1612,6 +1616,9 @@ function isBelowBreakLength(ctx, output, start, base) {
16121616
// Each entry is separated by at least a comma. Thus, we start with a total
16131617
// length of at least `output.length`. In addition, some cases have a
16141618
// whitespace in-between each other that is added to the total as well.
1619+
// TODO(BridgeAR): Add unicode support. Use the readline getStringWidth
1620+
// function. Check the performance overhead and make it an opt-in in case it's
1621+
// significant.
16151622
let totalLength = output.length + start;
16161623
if (totalLength + output.length > ctx.breakLength)
16171624
return false;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.