aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js')
-rw-r--r--deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js
index aa2f839b6d..b9bec62440 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js
@@ -16,6 +16,11 @@ module.exports = function (str) {
for (var i = 0; i < str.length; i++) {
var code = codePointAt(str, i);
+ // ignore control characters
+ if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) {
+ continue;
+ }
+
// surrogates
if (code >= 0x10000) {
i++;