File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,8 @@ The following options may be passed to the `highlight` function.
84
84
number: ' \x1b [32m' , // Numbers
85
85
string: ' \x1b [32m' , // Strings
86
86
special: ' \x1b [33m' , // Special characters
87
- bracket: ' \x1b [33m' // Brackets (parentheses)
87
+ bracket: ' \x1b [33m' , // Brackets (parentheses)
88
+ clear: ' \x1b [0m' // Clear (inserted after each match)
88
89
}
89
90
```
90
91
Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ const DEFAULT_OPTIONS = {
11
11
number : '\x1b[32m' ,
12
12
string : '\x1b[32m' ,
13
13
special : '\x1b[33m' ,
14
- bracket : '\x1b[33m'
14
+ bracket : '\x1b[33m' ,
15
+ clear : '\x1b[0m'
15
16
}
16
17
}
17
- const clearStyle = '\x1b[0m'
18
18
19
19
const SPLIT_CHARS = '[^a-zA-Z_]'
20
20
@@ -90,10 +90,9 @@ function highlight (sqlString, options) {
90
90
} else {
91
91
highlighted += options . colors [ match . name ]
92
92
highlighted += stringMatch
93
- highlighted += clearStyle
93
+ highlighted += options . colors . clear
94
94
}
95
95
96
-
97
96
if ( nextMatch ) {
98
97
highlighted += sqlString . substr ( match . start + match . length , nextMatch . start - ( match . start + match . length ) )
99
98
}
You can’t perform that action at this time.
0 commit comments