Skip to content

Commit 31c5bb1

Browse files
committed
fix(cell): Fix issue with checking on own property
1 parent 7f26310 commit 31c5bb1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Cell.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default class Cell {
124124
*/
125125
setBackground(colorName = 'none') {
126126
const color = colorName.toUpperCase();
127-
this._background = COLORS[color] ? color : 'none';
127+
this._background = COLORS.hasOwnProperty(color) ? color : 'none';
128128

129129
return this;
130130
}
@@ -146,7 +146,7 @@ export default class Cell {
146146
*/
147147
setForeground(colorName = 'none') {
148148
const color = colorName.toUpperCase();
149-
this._foreground = COLORS[color] ? color : 'none';
149+
this._foreground = COLORS.hasOwnProperty(color) ? color : 'none';
150150

151151
return this;
152152
}

0 commit comments

Comments
 (0)