Skip to content

Commit 008b526

Browse files
committed
Trim color name
Relates to #580
1 parent 4b89dca commit 008b526

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/prefix-color-selector.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ describe('#getNextColor()', () => {
3636
'blue',
3737
],
3838
},
39+
'trims colors': {
40+
customColors: [' red ', ' green ', ' blue '],
41+
expectedColors: ['red', 'green', 'blue'],
42+
},
3943
'accepts a string value for customColors': {
4044
customColors: 'red',
4145
expectedColors: ['red', 'red'],

lib/prefix-color-selector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@ export class PrefixColorSelector {
9696
* @returns The given custom colors then a set of acceptable console colors indefinitely.
9797
*/
9898
getNextColor(): string {
99-
return this.colorGenerator.next().value;
99+
return this.colorGenerator.next().value.trim();
100100
}
101101
}

0 commit comments

Comments
 (0)