Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[refactor] Check presence in color arrays instead of range

  • Loading branch information...
commit e7ef9dbaeae3477b032ffc35362909c17b96185e 1 parent a830963
@mmalecki authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/ansiparse.js
View
4 lib/ansiparse.js
@@ -64,10 +64,10 @@ ansiparse = function (str) {
// TODO: DRY.
//
ansiState.forEach(function (ansiCode) {
- if ((30 <= ansiCode) && (ansiCode <= 37)) {
+ if (ansiparse.foregroundColors[ansiCode]) {
state.foreground = ansiparse.foregroundColors[ansiCode];
}
- else if ((40 <= ansiCode) && (ansiCode <= 47)) {
+ else if (ansiparse.backgroundColors[ansiCode]) {
state.background = ansiparse.backgroundColors[ansiCode];
}
else if (ansiCode == 39) {
Please sign in to comment.
Something went wrong with that request. Please try again.