Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[refactor] Check presence in color arrays instead of range

  • Loading branch information...
commit e7ef9dbaeae3477b032ffc35362909c17b96185e 1 parent a830963
authored December 04, 2011

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  lib/ansiparse.js
4  lib/ansiparse.js
@@ -64,10 +64,10 @@ ansiparse = function (str) {
64 64
         // TODO: DRY.
65 65
         //
66 66
         ansiState.forEach(function (ansiCode) {
67  
-          if ((30 <= ansiCode) && (ansiCode <= 37)) {
  67
+          if (ansiparse.foregroundColors[ansiCode]) {
68 68
             state.foreground = ansiparse.foregroundColors[ansiCode];
69 69
           }
70  
-          else if ((40 <= ansiCode) && (ansiCode <= 47)) {
  70
+          else if (ansiparse.backgroundColors[ansiCode]) {
71 71
             state.background = ansiparse.backgroundColors[ansiCode];
72 72
           }
73 73
           else if (ansiCode == 39) {

0 notes on commit e7ef9db

Please sign in to comment.
Something went wrong with that request. Please try again.