Comparing version 2.2.0 to 2.2.2
17
index.js
@@ -61,3 +61,3 @@ 'use strict'; | ||
const codes = ansiStyles[key]; | ||
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], key); | ||
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); | ||
} | ||
@@ -67,2 +67,8 @@ }; | ||
styles.visible = { | ||
get() { | ||
return build.call(this, this._styles || [], true, 'visible'); | ||
} | ||
}; | ||
ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); | ||
@@ -84,3 +90,3 @@ for (const model of Object.keys(ansiStyles.color.ansi)) { | ||
}; | ||
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], model); | ||
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); | ||
}; | ||
@@ -108,3 +114,3 @@ } | ||
}; | ||
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], model); | ||
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); | ||
}; | ||
@@ -117,3 +123,3 @@ } | ||
function build(_styles, key) { | ||
function build(_styles, _empty, key) { | ||
const builder = function () { | ||
@@ -124,2 +130,3 @@ return applyStyle.apply(builder, arguments); | ||
builder._styles = _styles; | ||
builder._empty = _empty; | ||
@@ -176,3 +183,3 @@ const self = this; | ||
if (!this.enabled || this.level <= 0 || !str) { | ||
return str; | ||
return this._empty ? '' : str; | ||
} | ||
@@ -179,0 +186,0 @@ |
{ | ||
"name": "chalk", | ||
"version": "2.2.0", | ||
"version": "2.2.2", | ||
"description": "Terminal string styling done right", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -12,3 +12,3 @@ <h1 align="center"> | ||
[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) | ||
[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs) | ||
@@ -174,2 +174,3 @@ ### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0) | ||
- `strikethrough` *(Not widely supported)* | ||
- `visible` (Text is emitted only if enabled) | ||
@@ -176,0 +177,0 @@ ### Colors |
@@ -52,2 +52,4 @@ // Type definitions for Chalk | ||
visible: Chalk; | ||
black: Chalk; | ||
@@ -54,0 +56,0 @@ red: Chalk; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24242
373
310