remove iffy to gain performance
This commit is contained in:
parent
b8e7da6367
commit
fb3aa8e234
1 changed files with 9 additions and 13 deletions
22
index.js
22
index.js
|
|
@ -15,21 +15,17 @@ if (isSimpleWindowsTerm) {
|
||||||
ansiStyles.blue.open = '\u001b[94m';
|
ansiStyles.blue.open = '\u001b[94m';
|
||||||
}
|
}
|
||||||
|
|
||||||
var styles = (function () {
|
var styles = {};
|
||||||
var ret = {};
|
|
||||||
|
|
||||||
Object.keys(ansiStyles).forEach(function (key) {
|
Object.keys(ansiStyles).forEach(function (key) {
|
||||||
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
|
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
|
||||||
|
|
||||||
ret[key] = {
|
styles[key] = {
|
||||||
get: function () {
|
get: function () {
|
||||||
return build.call(this, this._styles.concat(key));
|
return build.call(this, this._styles.concat(key));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
return ret;
|
|
||||||
})();
|
|
||||||
|
|
||||||
var proto = defineProps(function chalk() {}, styles);
|
var proto = defineProps(function chalk() {}, styles);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue