mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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>
This commit is contained in:
11 files changed
+211
-192
No files matched your search
@@ -6,7 +6,7 @@ const {
|
||||
ObjectPrototypeHasOwnProperty,
|
||||
} = primordials;
|
||||
|
||||
const { getStringWidth } = require('internal/readline/utils');
|
||||
const { getStringWidth } = require('internal/util/inspect');
|
||||
|
||||
// The use of Unicode characters below is the only non-comment use of non-ASCII
|
||||
// Unicode characters in Node.js built-in modules. If they are ever removed or
|
||||
|
||||
Reference in new issue
Block a user