ansi-colors
Advanced tools
Comparing version 3.2.2 to 3.2.3
12
index.js
@@ -100,4 +100,12 @@ 'use strict'; | ||
const re = colors.ansiRegex = /\u001b\[\d+m/gm; | ||
colors.hasColor = colors.hasAnsi = str => !!str && typeof str === 'string' && re.test(str); | ||
colors.unstyle = str => typeof str === 'string' ? str.replace(re, '') : str; | ||
colors.hasColor = colors.hasAnsi = str => { | ||
re.lastIndex = 0; | ||
return !!str && typeof str === 'string' && re.test(str); | ||
}; | ||
colors.unstyle = str => { | ||
re.lastIndex = 0; | ||
return typeof str === 'string' ? str.replace(re, '') : str; | ||
}; | ||
colors.none = colors.clear = colors.noop = str => str; // no-op, for programmatic usage | ||
@@ -104,0 +112,0 @@ colors.stripColor = colors.unstyle; |
{ | ||
"name": "ansi-colors", | ||
"description": "Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"homepage": "https://github.com/doowb/ansi-colors", | ||
@@ -6,0 +6,0 @@ "author": "Brian Woodward (https://github.com/doowb)", |
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
20804
282