summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/chalk/node_modules/supports-color/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/node_modules/chalk/node_modules/supports-color/index.js')
-rw-r--r--tools/eslint/node_modules/chalk/node_modules/supports-color/index.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/chalk/node_modules/supports-color/index.js b/tools/eslint/node_modules/chalk/node_modules/supports-color/index.js
new file mode 100644
index 0000000000..a17196485d
--- /dev/null
+++ b/tools/eslint/node_modules/chalk/node_modules/supports-color/index.js
@@ -0,0 +1,43 @@
+'use strict';
+var argv = process.argv;
+
+module.exports = (function () {
+ if ('FORCE_COLOR' in process.env) {
+ return true;
+ }
+
+ if (argv.indexOf('--no-color') !== -1 ||
+ argv.indexOf('--no-colors') !== -1 ||
+ argv.indexOf('--color=false') !== -1) {
+ return false;
+ }
+
+ if (argv.indexOf('--color') !== -1 ||
+ argv.indexOf('--colors') !== -1 ||
+ argv.indexOf('--color=true') !== -1 ||
+ argv.indexOf('--color=always') !== -1) {
+ return true;
+ }
+
+ if (process.stdout && !process.stdout.isTTY) {
+ return false;
+ }
+
+ if (process.platform === 'win32') {
+ return true;
+ }
+
+ if ('COLORTERM' in process.env) {
+ return true;
+ }
+
+ if (process.env.TERM === 'dumb') {
+ return false;
+ }
+
+ if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
+ return true;
+ }
+
+ return false;
+})();