[Pkg-javascript-commits] [has-unicode] 11/16: Change

Ross Gammon ross-guest at moszumanska.debian.org
Tue Jan 31 18:56:44 UTC 2017


This is an automated email from the git hooks/post-receive script.

ross-guest pushed a commit to branch master
in repository has-unicode.

commit 704af38293e7710a805013446b3760ccb0acf215
Author: Yogiraj Kulkarni <yogirajkulkarni4 at gmail.com>
Date:   Thu Jan 5 12:14:10 2017 +0000

    Change
---
 debian/node-has-unicode/DEBIAN/control             |  13 +++++++
 debian/node-has-unicode/DEBIAN/md5sums             |   5 +++
 .../usr/lib/nodejs/has-unicode/index.js            |  16 ++++++++
 .../usr/lib/nodejs/has-unicode/package.json        |  30 ++++++++++++++
 .../usr/share/doc/node-has-unicode/README.md       |  43 +++++++++++++++++++++
 .../share/doc/node-has-unicode/changelog.Debian.gz | Bin 0 -> 174 bytes
 .../usr/share/doc/node-has-unicode/copyright       |  26 +++++++++++++
 7 files changed, 133 insertions(+)

diff --git a/debian/node-has-unicode/DEBIAN/control b/debian/node-has-unicode/DEBIAN/control
new file mode 100644
index 0000000..02e9929
--- /dev/null
+++ b/debian/node-has-unicode/DEBIAN/control
@@ -0,0 +1,13 @@
+Package: node-has-unicode
+Version: 2.0.1-1
+Architecture: all
+Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
+Installed-Size: 16
+Depends: nodejs
+Section: web
+Priority: optional
+Homepage: https://github.com/iarna/has-unicode
+Description: Try to guess if your terminal supports unicode
+ FIX_ME long description
+ .
+ Node.js is an event-based server-side JavaScript engine.
diff --git a/debian/node-has-unicode/DEBIAN/md5sums b/debian/node-has-unicode/DEBIAN/md5sums
new file mode 100644
index 0000000..def68b3
--- /dev/null
+++ b/debian/node-has-unicode/DEBIAN/md5sums
@@ -0,0 +1,5 @@
+c6ce2d7686d2808902abf12837367527  usr/lib/nodejs/has-unicode/index.js
+f14043c8a5d6df10d3671d83073d6883  usr/lib/nodejs/has-unicode/package.json
+de842566c06b4bbcbfa9ec3d8498adda  usr/share/doc/node-has-unicode/README.md
+36539f86e37fb5cbf602327662dea458  usr/share/doc/node-has-unicode/changelog.Debian.gz
+8b7cfa924a08b95ba08cade6f535a480  usr/share/doc/node-has-unicode/copyright
diff --git a/debian/node-has-unicode/usr/lib/nodejs/has-unicode/index.js b/debian/node-has-unicode/usr/lib/nodejs/has-unicode/index.js
new file mode 100644
index 0000000..9b0fe44
--- /dev/null
+++ b/debian/node-has-unicode/usr/lib/nodejs/has-unicode/index.js
@@ -0,0 +1,16 @@
+"use strict"
+var os = require("os")
+
+var hasUnicode = module.exports = function () {
+  // Recent Win32 platforms (>XP) CAN support unicode in the console but
+  // don't have to, and in non-english locales often use traditional local
+  // code pages. There's no way, short of windows system calls or execing
+  // the chcp command line program to figure this out. As such, we default
+  // this to false and encourage your users to override it via config if
+  // appropriate.
+  if (os.type() == "Windows_NT") { return false }
+
+  var isUTF8 = /UTF-?8$/i
+  var ctype = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG
+  return isUTF8.test(ctype)
+}
diff --git a/debian/node-has-unicode/usr/lib/nodejs/has-unicode/package.json b/debian/node-has-unicode/usr/lib/nodejs/has-unicode/package.json
new file mode 100644
index 0000000..ebe9d76
--- /dev/null
+++ b/debian/node-has-unicode/usr/lib/nodejs/has-unicode/package.json
@@ -0,0 +1,30 @@
+{
+  "name": "has-unicode",
+  "version": "2.0.1",
+  "description": "Try to guess if your terminal supports unicode",
+  "main": "index.js",
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/iarna/has-unicode"
+  },
+  "keywords": [
+    "unicode",
+    "terminal"
+  ],
+  "files": [
+    "index.js"
+  ],
+  "author": "Rebecca Turner <me at re-becca.org>",
+  "license": "ISC",
+  "bugs": {
+    "url": "https://github.com/iarna/has-unicode/issues"
+  },
+  "homepage": "https://github.com/iarna/has-unicode",
+  "devDependencies": {
+    "require-inject": "^1.3.0",
+    "tap": "^2.3.1"
+  }
+}
diff --git a/debian/node-has-unicode/usr/share/doc/node-has-unicode/README.md b/debian/node-has-unicode/usr/share/doc/node-has-unicode/README.md
new file mode 100644
index 0000000..5a03e59
--- /dev/null
+++ b/debian/node-has-unicode/usr/share/doc/node-has-unicode/README.md
@@ -0,0 +1,43 @@
+has-unicode
+===========
+
+Try to guess if your terminal supports unicode
+
+```javascript
+var hasUnicode = require("has-unicode")
+
+if (hasUnicode()) {
+  // the terminal probably has unicode support
+}
+```
+```javascript
+var hasUnicode = require("has-unicode").tryHarder
+hasUnicode(function(unicodeSupported) {
+  if (unicodeSupported) {
+    // the terminal probably has unicode support
+  }
+})
+```
+
+## Detecting Unicode
+
+What we actually detect is UTF-8 support, as that's what Node itself supports.
+If you have a UTF-16 locale then you won't be detected as unicode capable.
+
+### Windows
+
+Since at least Windows 7, `cmd` and `powershell` have been unicode capable,
+but unfortunately even then it's not guaranteed. In many localizations it
+still uses legacy code pages and there's no facility short of running
+programs or linking C++ that will let us detect this. As such, we
+report any Windows installation as NOT unicode capable, and recommend
+that you encourage your users to override this via config.
+
+### Unix Like Operating Systems
+
+We look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in
+that order.  For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. 
+For `LC_CTYPE` it looks to see if the value is `UTF-8`.  This is sufficient
+for most POSIX systems.  While locale data can be put in `/etc/locale.conf`
+as well, AFAIK it's always copied into the environment.
+
diff --git a/debian/node-has-unicode/usr/share/doc/node-has-unicode/changelog.Debian.gz b/debian/node-has-unicode/usr/share/doc/node-has-unicode/changelog.Debian.gz
new file mode 100644
index 0000000..792af99
Binary files /dev/null and b/debian/node-has-unicode/usr/share/doc/node-has-unicode/changelog.Debian.gz differ
diff --git a/debian/node-has-unicode/usr/share/doc/node-has-unicode/copyright b/debian/node-has-unicode/usr/share/doc/node-has-unicode/copyright
new file mode 100644
index 0000000..5d509ee
--- /dev/null
+++ b/debian/node-has-unicode/usr/share/doc/node-has-unicode/copyright
@@ -0,0 +1,26 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: has-unicode
+Upstream-Contact: https://github.com/iarna/has-unicode/issues
+Source: https://github.com/iarna/has-unicode
+
+Files: *
+Copyright: 2017 Rebecca Turner <me at re-becca.org>
+License: ISC
+
+Files: debian/*
+Copyright: 2017 Yogiraj Kulkarni <yogirajkulkarni1411 at gmail.com>
+License: ISC
+
+License: ISC
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/has-unicode.git



More information about the Pkg-javascript-commits mailing list