mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-29 11:00:11 +00:00
Update supports-colors.js
This commit is contained in:
parent
34a3d33de1
commit
2dc605c8cd
@ -24,10 +24,10 @@ THE SOFTWARE.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
const os = require('os');
|
||||
const hasFlag = require('./has-flag.js');
|
||||
var os = require('os');
|
||||
var hasFlag = require('./has-flag.js');
|
||||
|
||||
const env = process.env;
|
||||
var env = process.env;
|
||||
|
||||
let forceColor;
|
||||
if (hasFlag('no-color') ||
|
||||
@ -85,7 +85,7 @@ function supportsColor(stream) {
|
||||
// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
|
||||
// release that supports 256 colors. Windows 10 build 14931 is the first release
|
||||
// that supports 16m/TrueColor.
|
||||
const osRelease = os.release().split('.');
|
||||
var osRelease = os.release().split('.');
|
||||
if (
|
||||
Number(process.versions.node.split('.')[0]) >= 8 &&
|
||||
Number(osRelease[0]) >= 10 &&
|
||||
@ -110,7 +110,7 @@ function supportsColor(stream) {
|
||||
}
|
||||
|
||||
if ('TERM_PROGRAM' in env) {
|
||||
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
||||
var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
||||
|
||||
switch (env.TERM_PROGRAM) {
|
||||
case 'iTerm.app':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user