Comparing version 0.2.1 to 0.3.0
@@ -30,3 +30,5 @@ 'use strict'; | ||
get: function () { | ||
var obj = defineProps(function self(str) { | ||
var obj = defineProps(function self() { | ||
var str = [].slice.call(arguments).join(' '); | ||
if (!chalk.enabled) { | ||
@@ -55,3 +57,3 @@ return str; | ||
chalk.stripColor = function (str) { | ||
return str.replace(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/g, ''); | ||
return typeof str === 'string' ? str.replace(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/g, '') : str; | ||
}; | ||
@@ -58,0 +60,0 @@ |
{ | ||
"name": "chalk", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "Terminal string styling done right", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -37,3 +37,3 @@ # chalk [![Build Status](https://secure.travis-ci.org/sindresorhus/chalk.png?branch=master)](http://travis-ci.org/sindresorhus/chalk) | ||
// combine styled and normal strings | ||
console.log(chalk.blue('Hello') + 'World' + chalk.red('!')); | ||
console.log(chalk.blue('Hello'), 'World' + chalk.red('!')); | ||
@@ -44,3 +44,6 @@ // compose multiple styles using the chainable API | ||
// nest styles | ||
chalk.red('Hello' + chalk.underline.bgBlue('world') + '!'); | ||
chalk.red('Hello', chalk.underline.bgBlue('world') + '!'); | ||
// pass in multiple arguments | ||
console.log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')) | ||
``` | ||
@@ -63,2 +66,3 @@ | ||
Multiple arguments are also supported. Chalk will add a space between each one. | ||
@@ -65,0 +69,0 @@ ### chalk.enabled |
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
4991
48
135