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

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2016-06-24 01:12:07 +0300
committerRebecca Turner <me@re-becca.org>2016-06-24 03:32:42 +0300
commit6c3f7f043f09fc2aa19ffd3f956787635fa6f4d0 (patch)
tree852582e16d86ee078b48dbf7ab32636f1be7a633 /node_modules/has-unicode/index.js
parente44d2db1ad0d860ca08e99c81135bd399fb733b1 (diff)
has-unicode@2.0.1
Fix unicode dection on a number of Linux distributions. Credit: @Darkhogg Credit: @gagern Reviewed-By: @iarna PR-URL: https://github.com/iarna/has-unicode/pull/3 PR-URL: https://github.com/iarna/has-unicode/pull/4
Diffstat (limited to 'node_modules/has-unicode/index.js')
-rw-r--r--node_modules/has-unicode/index.js11
1 files changed, 3 insertions, 8 deletions
diff --git a/node_modules/has-unicode/index.js b/node_modules/has-unicode/index.js
index 9bf537b1c..9b0fe4454 100644
--- a/node_modules/has-unicode/index.js
+++ b/node_modules/has-unicode/index.js
@@ -10,12 +10,7 @@ var hasUnicode = module.exports = function () {
// appropriate.
if (os.type() == "Windows_NT") { return false }
- var isUTF8 = /[.]UTF-8/
- if (isUTF8.test(process.env.LC_ALL)
- || process.env.LC_CTYPE == 'UTF-8'
- || isUTF8.test(process.env.LANG)) {
- return true
- }
-
- return false
+ var isUTF8 = /UTF-?8$/i
+ var ctype = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG
+ return isUTF8.test(ctype)
}