Package: node-colors Version: 1.1.2-1 Severity: normal Tags: patch Dear Maintainer,
Before upstream github was taken over by NSA/Microsoft, there was a newer version of node-colors available upstream. The following patch patches node-colors to the newer version (a commit or two past 1.2.4). The changes include bug fixes, tweaks to the styling, improved tests and a slightly different API - see commit log for full details: https://notabug.org/themusicgod1/colors/commits/master . It's a lot of little changes(32K). Newer versions are required by other projects such as mist ( #827314 ). -- System Information: Debian Release: buster/sid APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 4.18.0-1-amd64 (SMP w/2 CPU cores) Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages node-colors depends on: ii nodejs 8.11.2~dfsg-1 node-colors recommends no packages. node-colors suggests no packages. -- no debconf information
diff -r colors.js-1.2.4/debian/changelog colors.js-1.1.2/debian/changelog 1,6d0 < colors.js (1.2.4-1) UNRELEASED; urgency=medium < < * New upstream version 1.2.4-1 < < -- Jeffrey Cliff <jeffrey.cl...@gmail.com> Mon, 08 Oct 2018 09:57:02 +0500 < diff -r colors.js-1.2.4/debian/control colors.js-1.1.2/debian/control 14c14 < Depends: ${misc:Depends}, nodejs(>= 0.1.90) --- > Depends: ${misc:Depends}, nodejs Only in colors.js-1.2.4/debian: .debhelper Only in colors.js-1.2.4/debian: files Only in colors.js-1.2.4/debian: node-colors Only in colors.js-1.2.4/debian: node-colors.debhelper.log Only in colors.js-1.2.4/debian: node-colors.substvars Only in colors.js-1.2.4: .eslintrc.json diff -r colors.js-1.2.4/examples/normal-usage.js colors.js-1.1.2/examples/normal-usage.js 3c3 < console.log('First some yellow text'.yellow); --- > console.log("First some yellow text".yellow); 5c5 < console.log('Underline that text'.yellow.underline); --- > console.log("Underline that text".yellow.underline); 7c7 < console.log('Make it bold and red'.red.bold); --- > console.log("Make it bold and red".red.bold); 9c9 < console.log(('Double Raindows All Day Long').rainbow); --- > console.log(("Double Raindows All Day Long").rainbow) 11c11 < console.log('Drop the bass'.trap); --- > console.log("Drop the bass".trap) 13c13 < console.log('DROP THE RAINBOW BASS'.trap.rainbow); --- > console.log("DROP THE RAINBOW BASS".trap.rainbow) 15,16d14 < // styles not widely supported < console.log('Chains are also cool.'.bold.italic.underline.red); 18,21c16,19 < // styles not widely supported < console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse < + ' styles! '.yellow.bold); < console.log('Zebras are so fun!'.zebra); --- > console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported > > console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse + ' styles! '.yellow.bold); // styles not widely supported > console.log("Zebras are so fun!".zebra); 26c24 < console.log('This is ' + 'not'.strikethrough + ' fun.'); --- > console.log("This is " + "not".strikethrough + " fun."); 28,30c26,28 < console.log('Background color attack!'.black.bgWhite); < console.log('Use random styles on everything!'.random); < console.log('America, Heck Yeah!'.america); --- > console.log('Background color attack!'.black.bgWhite) > console.log('Use random styles on everything!'.random) > console.log('America, Heck Yeah!'.america) 33c31 < console.log('Setting themes is useful'); --- > console.log('Setting themes is useful') 50c48 < error: 'red', --- > error: 'red' 54c52 < console.log('this is an error'.error); --- > console.log("this is an error".error); 57c55 < console.log('this is a warning'.warn); --- > console.log("this is a warning".warn); 60c58 < console.log('this is an input'.input); --- > console.log("this is an input".input); 65,69c63 < try { < colors.setTheme(require(__dirname + '/../themes/generic-logging.js')); < } catch (err) { < console.log(err); < } --- > colors.setTheme(__dirname + '/../themes/generic-logging.js'); 72c66 < console.log('this is an error'.error); --- > console.log("this is an error".error); 75c69 < console.log('this is a warning'.warn); --- > console.log("this is a warning".warn); 78,80c72 < console.log('this is an input'.input); < < // console.log("Don't summon".zalgo) --- > console.log("this is an input".input); 81a74 > //console.log("Don't summon".zalgo) \ No newline at end of file diff -r colors.js-1.2.4/examples/safe-string.js colors.js-1.1.2/examples/safe-string.js 3c3 < console.log(colors.yellow('First some yellow text')); --- > console.log(colors.yellow("First some yellow text")); 5c5 < console.log(colors.yellow.underline('Underline that text')); --- > console.log(colors.yellow.underline("Underline that text")); 7c7 < console.log(colors.red.bold('Make it bold and red')); --- > console.log(colors.red.bold("Make it bold and red")); 9c9 < console.log(colors.rainbow('Double Raindows All Day Long')); --- > console.log(colors.rainbow("Double Raindows All Day Long")) 11c11 < console.log(colors.trap('Drop the bass')); --- > console.log(colors.trap("Drop the bass")) 13c13 < console.log(colors.rainbow(colors.trap('DROP THE RAINBOW BASS'))); --- > console.log(colors.rainbow(colors.trap("DROP THE RAINBOW BASS"))); 15,16c15 < // styles not widely supported < console.log(colors.bold.italic.underline.red('Chains are also cool.')); --- > console.log(colors.bold.italic.underline.red('Chains are also cool.')); // styles not widely supported 18,20d16 < // styles not widely supported < console.log(colors.green('So ') + colors.underline('are') + ' ' < + colors.inverse('inverse') + colors.yellow.bold(' styles! ')); 22c18 < console.log(colors.zebra('Zebras are so fun!')); --- > console.log(colors.green('So ') + colors.underline('are') + ' ' + colors.inverse('inverse') + colors.yellow.bold(' styles! ')); // styles not widely supported 24c20,22 < console.log('This is ' + colors.strikethrough('not') + ' fun.'); --- > console.log(colors.zebra("Zebras are so fun!")); > > console.log("This is " + colors.strikethrough("not") + " fun."); 28c26 < console.log(colors.random('Use random styles on everything!')); --- > console.log(colors.random('Use random styles on everything!')) 31c29 < console.log('Setting themes is useful'); --- > console.log('Setting themes is useful') 36c34 < // console.log('Generic logging theme as JSON'.green.bold.underline); --- > //console.log('Generic logging theme as JSON'.green.bold.underline); 48c46 < error: 'red', --- > error: 'red' 52c50 < console.log(colors.error('this is an error')); --- > console.log(colors.error("this is an error")); 55c53 < console.log(colors.warn('this is a warning')); --- > console.log(colors.warn("this is a warning")); 58c56 < console.log(colors.input('this is an input')); --- > console.log(colors.input("this is an input")); 67c65 < console.log(colors.error('this is an error')); --- > console.log(colors.error("this is an error")); 70c68 < console.log(colors.warn('this is a warning')); --- > console.log(colors.warn("this is a warning")); 73c71 < console.log(colors.input('this is an input')); --- > console.log(colors.input("this is an input")); 75a74 > Only in colors.js-1.2.4: .git Only in colors.js-1.2.4: .gitignore Only in colors.js-1.2.4: index.d.ts diff -r colors.js-1.2.4/lib/colors.js colors.js-1.1.2/lib/colors.js 5c5 < Original Library --- > Original Library 36d35 < var util = require('util'); 39d37 < var newLineRegex = new RegExp(/[\r\n]+/g); 41c39 < colors.supportsColor = require('./system/supports-colors').supportsColor; --- > colors.supportsColor = require('./system/supports-colors'); 43,44c41,42 < if (typeof colors.enabled === 'undefined') { < colors.enabled = colors.supportsColor() !== false; --- > if (typeof colors.enabled === "undefined") { > colors.enabled = colors.supportsColor; 47,48c45,46 < colors.enable = function() { < colors.enabled = true; --- > colors.stripColors = colors.strip = function(str){ > return ("" + str).replace(/\x1B\[\d+m/g, ''); 51,57d48 < colors.disable = function() { < colors.enabled = false; < }; < < colors.stripColors = colors.strip = function(str) { < return ('' + str).replace(/\x1B\[\d+m/g, ''); < }; 59,60c50 < // eslint-disable-next-line no-unused-vars < var stylize = colors.stylize = function stylize(str, style) { --- > var stylize = colors.stylize = function stylize (str, style) { 66c56 < }; --- > } 69c59 < var escapeStringRegexp = function(str) { --- > var escapeStringRegexp = function (str) { 73,74c63,64 < return str.replace(matchOperatorsRe, '\\$&'); < }; --- > return str.replace(matchOperatorsRe, '\\$&'); > } 87c77 < var styles = (function() { --- > var styles = (function () { 90,92c80,81 < Object.keys(ansiStyles).forEach(function(key) { < ansiStyles[key].closeRe = < new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); --- > Object.keys(ansiStyles).forEach(function (key) { > ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); 94c83 < get: function() { --- > get: function () { 96c85 < }, --- > } 105,111c94,99 < var args = Array.prototype.slice.call(arguments); < < var str = args.map(function(arg) { < if (arg !== undefined && arg.constructor === String) { < return arg; < } else { < return util.inspect(arg); --- > var args = arguments; > var argsLen = args.length; > var str = argsLen !== 0 && String(arguments[0]); > if (argsLen > 1) { > for (var a = 1; a < argsLen; a++) { > str += ' ' + args[a]; 113c101 < }).join(' '); --- > } 119,120d106 < var newLinesPresent = str.indexOf('\n') != -1; < 127,129d112 < if (newLinesPresent) { < str = str.replace(newLineRegex, code.close + '\n' + code.open); < } 135,145c118 < colors.setTheme = function(theme) { < if (typeof theme === 'string') { < console.log('colors.setTheme now only accepts an object, not a string. ' + < 'If you are trying to set a theme from a file, it is now your (the ' + < 'caller\'s) responsibility to require the file. The old syntax ' + < 'looked like colors.setTheme(__dirname + ' + < '\'/../themes/generic-logging.js\'); The new syntax looks like '+ < 'colors.setTheme(require(__dirname + ' + < '\'/../themes/generic-logging.js\'));'); < return; < } --- > function applyTheme (theme) { 147,149c120,122 < (function(style) { < colors[style] = function(str) { < if (typeof theme[style] === 'object') { --- > (function(style){ > colors[style] = function(str){ > if (typeof theme[style] === 'object'){ 151c124 < for (var i in theme[style]) { --- > for (var i in theme[style]){ 158c131,146 < })(style); --- > })(style) > } > } > > colors.setTheme = function (theme) { > if (typeof theme === 'string') { > try { > colors.themes[theme] = require(theme); > applyTheme(colors.themes[theme]); > return colors.themes[theme]; > } catch (err) { > console.log(err); > return err; > } > } else { > applyTheme(theme); 164c152 < Object.keys(styles).forEach(function(name) { --- > Object.keys(styles).forEach(function (name) { 166c154 < get: function() { --- > get: function () { 168c156 < }, --- > } 174,175c162,163 < var sequencer = function sequencer(map, str) { < var exploded = str.split(''); --- > var sequencer = function sequencer (map, str) { > var exploded = str.split(""), i = 0; 177c165 < return exploded.join(''); --- > return exploded.join(""); 189c177 < colors.maps.random = require('./maps/random'); --- > colors.maps.random = require('./maps/random') 192,193c180,181 < (function(map) { < colors[map] = function(str) { --- > (function(map){ > colors[map] = function (str) { 195,196c183,184 < }; < })(map); --- > } > })(map) 199c187 < defineProps(colors, init()); --- > defineProps(colors, init()); \ No newline at end of file diff -r colors.js-1.2.4/lib/custom/trap.js colors.js-1.1.2/lib/custom/trap.js 1,3c1,3 < module['exports'] = function runTheTrap(text, options) { < var result = ''; < text = text || 'Run the trap, drop the bass'; --- > module['exports'] = function runTheTrap (text, options) { > var result = ""; > text = text || "Run the trap, drop the bass"; 6,35c6,33 < a: ['\u0040', '\u0104', '\u023a', '\u0245', '\u0394', '\u039b', '\u0414'], < b: ['\u00df', '\u0181', '\u0243', '\u026e', '\u03b2', '\u0e3f'], < c: ['\u00a9', '\u023b', '\u03fe'], < d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'], < e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc', < '\u0a6c'], < f: ['\u04fa'], < g: ['\u0262'], < h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'], < i: ['\u0f0f'], < j: ['\u0134'], < k: ['\u0138', '\u04a0', '\u04c3', '\u051e'], < l: ['\u0139'], < m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'], < n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'], < o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd', < '\u06dd', '\u0e4f'], < p: ['\u01f7', '\u048e'], < q: ['\u09cd'], < r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'], < s: ['\u00a7', '\u03de', '\u03df', '\u03e8'], < t: ['\u0141', '\u0166', '\u0373'], < u: ['\u01b1', '\u054d'], < v: ['\u05d8'], < w: ['\u0428', '\u0460', '\u047c', '\u0d70'], < x: ['\u04b2', '\u04fe', '\u04fc', '\u04fd'], < y: ['\u00a5', '\u04b0', '\u04cb'], < z: ['\u01b5', '\u0240'], < }; < text.forEach(function(c) { --- > a: ["\u0040", "\u0104", "\u023a", "\u0245", "\u0394", "\u039b", "\u0414"], > b: ["\u00df", "\u0181", "\u0243", "\u026e", "\u03b2", "\u0e3f"], > c: ["\u00a9", "\u023b", "\u03fe"], > d: ["\u00d0", "\u018a", "\u0500" , "\u0501" ,"\u0502", "\u0503"], > e: ["\u00cb", "\u0115", "\u018e", "\u0258", "\u03a3", "\u03be", "\u04bc", "\u0a6c"], > f: ["\u04fa"], > g: ["\u0262"], > h: ["\u0126", "\u0195", "\u04a2", "\u04ba", "\u04c7", "\u050a"], > i: ["\u0f0f"], > j: ["\u0134"], > k: ["\u0138", "\u04a0", "\u04c3", "\u051e"], > l: ["\u0139"], > m: ["\u028d", "\u04cd", "\u04ce", "\u0520", "\u0521", "\u0d69"], > n: ["\u00d1", "\u014b", "\u019d", "\u0376", "\u03a0", "\u048a"], > o: ["\u00d8", "\u00f5", "\u00f8", "\u01fe", "\u0298", "\u047a", "\u05dd", "\u06dd", "\u0e4f"], > p: ["\u01f7", "\u048e"], > q: ["\u09cd"], > r: ["\u00ae", "\u01a6", "\u0210", "\u024c", "\u0280", "\u042f"], > s: ["\u00a7", "\u03de", "\u03df", "\u03e8"], > t: ["\u0141", "\u0166", "\u0373"], > u: ["\u01b1", "\u054d"], > v: ["\u05d8"], > w: ["\u0428", "\u0460", "\u047c", "\u0d70"], > x: ["\u04b2", "\u04fe", "\u04fc", "\u04fd"], > y: ["\u00a5", "\u04b0", "\u04cb"], > z: ["\u01b5", "\u0240"] > } > text.forEach(function(c){ 37c35 < var chars = trap[c] || [' ']; --- > var chars = trap[c] || [" "]; 39c37 < if (typeof trap[c] !== 'undefined') { --- > if (typeof trap[c] !== "undefined") { 46c44,45 < }; --- > > } diff -r colors.js-1.2.4/lib/custom/zalgo.js colors.js-1.1.2/lib/custom/zalgo.js 3c3 < text = text || ' he is here '; --- > text = text || " he is here "; 5c5 < 'up': [ --- > "up" : [ 18c18 < '??', '??', --- > '??', '??' 20c20 < 'down': [ --- > "down" : [ 30c30 < '??', '??', '??', '??', --- > '??', '??', '??', '??' 32c32 < 'mid': [ --- > "mid" : [ 38,41c38,42 < '??', '??', ' ??', < ], < }; < var all = [].concat(soul.up, soul.down, soul.mid); --- > '??', '??', ' ??' > ] > }, > all = [].concat(soul.up, soul.down, soul.mid), > zalgo = {}; 48c49 < function isChar(character) { --- > function is_char(character) { 50c51 < all.filter(function(i) { --- > all.filter(function (i) { 55c56 < --- > 58,60c59 < var result = ''; < var counts; < var l; --- > var result = '', counts, l; 62,69c61,64 < options['up'] = < typeof options['up'] !== 'undefined' ? options['up'] : true; < options['mid'] = < typeof options['mid'] !== 'undefined' ? options['mid'] : true; < options['down'] = < typeof options['down'] !== 'undefined' ? options['down'] : true; < options['size'] = < typeof options['size'] !== 'undefined' ? options['size'] : 'maxi'; --- > options["up"] = typeof options["up"] !== 'undefined' ? options["up"] : true; > options["mid"] = typeof options["mid"] !== 'undefined' ? options["mid"] : true; > options["down"] = typeof options["down"] !== 'undefined' ? options["down"] : true; > options["size"] = typeof options["size"] !== 'undefined' ? options["size"] : "maxi"; 72c67 < if (isChar(l)) { --- > if (is_char(l)) { 76c71 < counts = {'up': 0, 'down': 0, 'mid': 0}; --- > counts = {"up" : 0, "down" : 0, "mid" : 0}; 95c90 < var arr = ['up', 'mid', 'down']; --- > var arr = ["up", "mid", "down"]; 98c93 < for (var i = 0; i <= counts[index]; i++) { --- > for (var i = 0 ; i <= counts[index]; i++) { 109,110c104 < }; < --- > } diff -r colors.js-1.2.4/lib/extendStringPrototype.js colors.js-1.1.2/lib/extendStringPrototype.js 3c3,4 < module['exports'] = function() { --- > module['exports'] = function () { > 7c8 < var addProperty = function(color, func) { --- > var addProperty = function (color, func) { 11c12,20 < addProperty('strip', function() { --- > var sequencer = function sequencer (map, str) { > return function () { > var exploded = this.split(""), i = 0; > exploded = exploded.map(map); > return exploded.join(""); > } > }; > > addProperty('strip', function () { 15c24 < addProperty('stripColors', function() { --- > addProperty('stripColors', function () { 19c28 < addProperty('trap', function() { --- > addProperty("trap", function(){ 23c32 < addProperty('zalgo', function() { --- > addProperty("zalgo", function(){ 27c36 < addProperty('zebra', function() { --- > addProperty("zebra", function(){ 31c40 < addProperty('rainbow', function() { --- > addProperty("rainbow", function(){ 35c44 < addProperty('random', function() { --- > addProperty("random", function(){ 39c48 < addProperty('america', function() { --- > addProperty("america", function(){ 47,48c56,57 < x.forEach(function(style) { < addProperty(style, function() { --- > x.forEach(function (style) { > addProperty(style, function () { 59,65c68,71 < '__defineGetter__', '__defineSetter__', '__lookupGetter__', < '__lookupSetter__', 'charAt', 'constructor', 'hasOwnProperty', < 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', < 'valueOf', 'charCodeAt', 'indexOf', 'lastIndexOf', 'length', < 'localeCompare', 'match', 'repeat', 'replace', 'search', 'slice', < 'split', 'substring', 'toLocaleLowerCase', 'toLocaleUpperCase', < 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', --- > '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor', > 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt', > 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring', > 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight' 68c74 < Object.keys(theme).forEach(function(prop) { --- > Object.keys(theme).forEach(function (prop) { 70,73c76,78 < console.log('warn: '.red + ('String.prototype' + prop).magenta + < ' is probably something you don\'t want to override. ' + < 'Ignoring style name'); < } else { --- > console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name'); > } > else { 76c81 < addProperty(prop, function() { --- > addProperty(prop, function () { 79,80c84,86 < } else { < addProperty(prop, function() { --- > } > else { > addProperty(prop, function () { 92c98 < colors.setTheme = function(theme) { --- > colors.setTheme = function (theme) { 94,101c100,107 < console.log('colors.setTheme now only accepts an object, not a string. ' + < 'If you are trying to set a theme from a file, it is now your (the ' + < 'caller\'s) responsibility to require the file. The old syntax ' + < 'looked like colors.setTheme(__dirname + ' + < '\'/../themes/generic-logging.js\'); The new syntax looks like '+ < 'colors.setTheme(require(__dirname + ' + < '\'/../themes/generic-logging.js\'));'); < return; --- > try { > colors.themes[theme] = require(theme); > applyTheme(colors.themes[theme]); > return colors.themes[theme]; > } catch (err) { > console.log(err); > return err; > } 106c112,113 < }; --- > > }; \ No newline at end of file diff -r colors.js-1.2.4/lib/index.js colors.js-1.1.2/lib/index.js 4c4 < // Remark: By default, colors will add style properties to String.prototype. --- > // Remark: By default, colors will add style properties to String.prototype 6,7c6 < // If you don't wish to extend String.prototype, you can do this instead and < // native String will not be touched: --- > // If you don't wish to extend String.prototype you can do this instead and native String will not be touched 13c12 < require('./extendStringPrototype')(); --- > require('./extendStringPrototype')(); \ No newline at end of file diff -r colors.js-1.2.4/lib/maps/america.js colors.js-1.1.2/lib/maps/america.js 4,6c4,6 < return function(letter, i, exploded) { < if (letter === ' ') return letter; < switch (i%3) { --- > return function (letter, i, exploded) { > if(letter === " ") return letter; > switch(i%3) { 8,9c8,9 < case 1: return colors.white(letter); < case 2: return colors.blue(letter); --- > case 1: return colors.white(letter) > case 2: return colors.blue(letter) 11,12c11,12 < }; < })(); --- > } > })(); \ No newline at end of file diff -r colors.js-1.2.4/lib/maps/rainbow.js colors.js-1.1.2/lib/maps/rainbow.js 3,7c3,6 < module['exports'] = (function() { < // RoY G BiV < var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; < return function(letter, i, exploded) { < if (letter === ' ') { --- > module['exports'] = (function () { > var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV > return function (letter, i, exploded) { > if (letter === " ") { diff -r colors.js-1.2.4/lib/maps/random.js colors.js-1.1.2/lib/maps/random.js 3,5c3,4 < module['exports'] = (function() { < var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', < 'blue', 'white', 'cyan', 'magenta']; --- > module['exports'] = (function () { > var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; 7,10c6 < return letter === ' ' ? letter : < colors[ < available[Math.round(Math.random() * (available.length - 2))] < ](letter); --- > return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 1))]](letter); 12c8 < })(); --- > })(); \ No newline at end of file diff -r colors.js-1.2.4/lib/maps/zebra.js colors.js-1.1.2/lib/maps/zebra.js 3c3 < module['exports'] = function(letter, i, exploded) { --- > module['exports'] = function (letter, i, exploded) { 5c5 < }; --- > }; \ No newline at end of file diff -r colors.js-1.2.4/lib/styles.js colors.js-1.1.2/lib/styles.js 68c68 < whiteBG: [47, 49], --- > whiteBG: [47, 49] 72c72 < Object.keys(codes).forEach(function(key) { --- > Object.keys(codes).forEach(function (key) { 77c77 < }); --- > }); \ No newline at end of file Only in colors.js-1.2.4/lib/system: has-flag.js diff -r colors.js-1.2.4/lib/system/supports-colors.js colors.js-1.1.2/lib/system/supports-colors.js 26c26 < 'use strict'; --- > var argv = process.argv; 28,46c28,30 < var os = require('os'); < var hasFlag = require('./has-flag.js'); < < var env = process.env; < < var forceColor = void 0; < if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) { < forceColor = false; < } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') < || hasFlag('color=always')) { < forceColor = true; < } < if ('FORCE_COLOR' in env) { < forceColor = env.FORCE_COLOR.length === 0 < || parseInt(env.FORCE_COLOR, 10) !== 0; < } < < function translateLevel(level) { < if (level === 0) { --- > module.exports = (function () { > if (argv.indexOf('--no-color') !== -1 || > argv.indexOf('--color=false') !== -1) { 50,65c34,37 < return { < level: level, < hasBasic: true, < has256: level >= 2, < has16m: level >= 3, < }; < } < < function supportsColor(stream) { < if (forceColor === false) { < return 0; < } < < if (hasFlag('color=16m') || hasFlag('color=full') < || hasFlag('color=truecolor')) { < return 3; --- > if (argv.indexOf('--color') !== -1 || > argv.indexOf('--color=true') !== -1 || > argv.indexOf('--color=always') !== -1) { > return true; 68,73c40,41 < if (hasFlag('color=256')) { < return 2; < } < < if (stream && !stream.isTTY && forceColor !== true) { < return 0; --- > if (process.stdout && !process.stdout.isTTY) { > return false; 76,77d43 < var min = forceColor ? 1 : 0; < 79,124c45 < // Node.js 7.5.0 is the first version of Node.js to include a patch to < // libuv that enables 256 color output on Windows. Anything earlier and it < // won't work. However, here we target Node.js 8 at minimum as it is an LTS < // 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. < var osRelease = os.release().split('.'); < if (Number(process.versions.node.split('.')[0]) >= 8 < && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { < return Number(osRelease[2]) >= 14931 ? 3 : 2; < } < < return 1; < } < < if ('CI' in env) { < if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) { < return sign in env; < }) || env.CI_NAME === 'codeship') { < return 1; < } < < return min; < } < < if ('TEAMCITY_VERSION' in env) { < return (/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0 < ); < } < < if ('TERM_PROGRAM' in env) { < var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); < < switch (env.TERM_PROGRAM) { < case 'iTerm.app': < return version >= 3 ? 3 : 2; < case 'Hyper': < return 3; < case 'Apple_Terminal': < return 2; < // No default < } < } < < if (/-256(color)?$/i.test(env.TERM)) { < return 2; --- > return true; 127,128c48,49 < if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { < return 1; --- > if ('COLORTERM' in process.env) { > return true; 131,132c52,53 < if ('COLORTERM' in env) { < return 1; --- > if (process.env.TERM === 'dumb') { > return false; 135,136c56,57 < if (env.TERM === 'dumb') { < return min; --- > if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { > return true; 139,151c60,61 < return min; < } < < function getSupportLevel(stream) { < var level = supportsColor(stream); < return translateLevel(level); < } < < module.exports = { < supportsColor: getSupportLevel, < stdout: getSupportLevel(process.stdout), < stderr: getSupportLevel(process.stderr), < }; --- > return false; > })(); \ No newline at end of file diff -r colors.js-1.2.4/LICENSE colors.js-1.1.2/LICENSE 1,2d0 < MIT License < 25c23 < THE SOFTWARE. --- > THE SOFTWARE. \ No newline at end of file Only in colors.js-1.2.4: .npmignore diff -r colors.js-1.2.4/package.json colors.js-1.1.2/package.json 4c4 < "version": "1.3.0", --- > "version": "1.1.2", 8,12c8 < "keywords": [ < "ansi", < "terminal", < "colors" < ], --- > "keywords": [ "ansi", "terminal", "colors" ], 19,20c15 < "lint": "eslint . --fix", < "test": "node tests/basic-test.js && node tests/safe-test.js" --- > "test": "node tests/basic-test.js && node tests/safe-test.js" 25c20 < "main": "lib/index.js", --- > "main": "lib", 31,38c26,27 < "themes", < "index.d.ts", < "safe.d.ts" < ], < "devDependencies": { < "eslint": "^4.19.1", < "eslint-config-google": "^0.9.1" < } --- > "themes" > ] Only in colors.js-1.2.4: package-lock.json Only in colors.js-1.1.2: ReadMe.md Only in colors.js-1.2.4: README.md Only in colors.js-1.2.4: ROADMAP.md Only in colors.js-1.2.4: safe.d.ts diff -r colors.js-1.2.4/safe.js colors.js-1.1.2/safe.js 2,3c2 < // Remark: Requiring this file will use the "safe" colors API, < // which will not touch String.prototype. --- > // Remark: Requiring this file will use the "safe" colors API which will not touch String.prototype 5c4 < // var colors = require('colors/safe'); --- > // var colors = require('colors/safe); 10c9 < module['exports'] = colors; --- > module['exports'] = colors; \ No newline at end of file diff -r colors.js-1.2.4/tests/basic-test.js colors.js-1.1.2/tests/basic-test.js 1,2c1,2 < var assert = require('assert'); < var colors = require('../lib/index'); --- > var assert = require('assert'), > colors = require('../lib/index'); 18,22c18,23 < var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', < 'red', 'yellow']; < // eslint-disable-next-line < var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', < 'inverse', 'rainbow']); --- > function h(s, color) { > return '<span style="color:' + color + ';">' + s + '</span>'; > } > > var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; > var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); 45,51c46 < var testStringWithNewLines = s + '\n' + s; < < // single style < assert.equal(testStringWithNewLines.red, '\x1b[31m' + s + '\n' + s + < '\x1b[39m'); < < var testStringWithNewLinesStyled = s.underline + '\n' + s.bold; --- > colors.setTheme({error:'red'}); 53,56c48,49 < // nested styles < assert.equal(testStringWithNewLinesStyled.red, < '\x1b[31m' + '\x1b[4m' + s + '\x1b[24m' + '\n' + '\x1b[1m' + s + < '\x1b[22m' + '\x1b[39m'); --- > assert.equal(typeof("astring".red),'string'); > assert.equal(typeof("astring".error),'string'); 58,63d50 < colors.setTheme({error: 'red'}); < < assert.equal(typeof ('astring'.red), 'string'); < assert.equal(typeof ('astring'.error), 'string'); < < assert.equal(s, 'string'); diff -r colors.js-1.2.4/tests/safe-test.js colors.js-1.1.2/tests/safe-test.js 1,2c1,2 < var assert = require('assert'); < var colors = require('../safe'); --- > var assert = require('assert'), > colors = require('../safe'); 15,19c15,20 < var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', < 'red', 'yellow']; < // eslint-disable-next-line < var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', < 'rainbow']); --- > function h(s, color) { > return '<span style="color:' + color + ';">' + s + '</span>'; > } > > var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; > var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); 40a42 > colors.setTheme({error:'red'}); 42,59c44,45 < var testStringWithNewLines = s + '\n' + s; < < // single style < assert.equal(colors.red(testStringWithNewLines), < '\x1b[31m' + s + '\x1b[39m' + '\n' + '\x1b[31m' + s + '\x1b[39m'); < < var testStringWithNewLinesStyled = colors.underline(s) + '\n' + colors.bold(s); < < // nested styles < assert.equal(colors.red(testStringWithNewLinesStyled), < '\x1b[31m' + '\x1b[4m' + s + '\x1b[24m' + '\x1b[39m' + '\n' + '\x1b[31m' + < '\x1b[1m' + s + '\x1b[22m' + '\x1b[39m'); < < colors.setTheme({error: 'red'}); < < assert.equal(typeof (colors.red('astring')), 'string'); < assert.equal(typeof (colors.error('astring')), 'string'); < --- > assert.equal(typeof(colors.red("astring")), 'string'); > assert.equal(typeof(colors.error("astring")), 'string'); \ No newline at end of file diff -r colors.js-1.2.4/themes/generic-logging.js colors.js-1.1.2/themes/generic-logging.js 11,12c11,12 < error: 'red', < }; --- > error: 'red' > }; \ No newline at end of file diff -r colors.js-1.2.4/.travis.yml colors.js-1.1.2/.travis.yml 3,10d2 < - "10" < - "9" < - "8" < - "7" < - "6" < - "5" < - "4" < - "0.12" 14,16c6 < script: < - npm install < - npm test --- > - "0.6" \ No newline at end of file