Skip to content

Commit d1ff3a7

Browse files
committed
Reverse conditional expression
Close #78
1 parent 02d2141 commit d1ff3a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ export const isColorSupported =
1717
!isDisabled && (isForced || isWindows || isCompatibleTerminal || isCI)
1818

1919
const raw = (open, close, searchRegex, replaceValue) => (s) =>
20-
!s && (s === "" || s === undefined)
21-
? ""
22-
: open +
20+
s || !(s === "" || s === undefined)
21+
? open +
2322
(~(s + "").indexOf(close, 4) // skip opening \x1b[
2423
? s.replace(searchRegex, replaceValue)
2524
: s) +
2625
close
26+
: ""
2727

2828
const init = (open, close) =>
2929
raw(

0 commit comments

Comments
 (0)