Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2020-01-11 21:48:40 +0300
committerRuben Bridgewater <ruben@bridgewater.de>2020-01-22 17:33:03 +0300
commit8fb5fe28a45cc884567cd39e3b2f6b4272917af6 (patch)
tree3d27acb62947f1d2344b8f55bafc0e898ae7629f /lib/internal/repl
parent2606e1ed25b63694adccf7756d10ef51722a14ce (diff)
util: improve unicode support
The array grouping function relies on the width of the characters. It was not calculated correct so far, since it used the string length instead. This improves the unicode output by calculating the mono-spaced font width (other fonts might differ). PR-URL: https://github.com/nodejs/node/pull/31319 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Diffstat (limited to 'lib/internal/repl')
-rw-r--r--lib/internal/repl/utils.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/internal/repl/utils.js b/lib/internal/repl/utils.js
index 3449eab785f..49a40e3030a 100644
--- a/lib/internal/repl/utils.js
+++ b/lib/internal/repl/utils.js
@@ -32,11 +32,13 @@ const {
const {
commonPrefix,
- getStringWidth,
kSubstringSearch,
} = require('internal/readline/utils');
-const { inspect } = require('util');
+const {
+ getStringWidth,
+ inspect,
+} = require('internal/util/inspect');
const debug = require('internal/util/debuglog').debuglog('repl');