@@ -12,12 +12,8 @@ export default class PaletteError extends Error {
12
12
* @constructor
13
13
* @param {(string | Error) } message - The error message or an Error object.
14
14
*/
15
- constructor ( message : string | Error ) {
16
- super ( (
17
- message as Error
18
- ) ?. message || (
19
- message as string
20
- ) ) ;
15
+ constructor ( message : string | Error ) {
16
+ super ( ( message as Error ) ?. message || ( message as string ) ) ;
21
17
22
18
/**
23
19
* The name of the error.
@@ -32,8 +28,7 @@ export default class PaletteError extends Error {
32
28
* @param {Chalk } [chain] - The Chalk instance to chain with.
33
29
* @returns {Chalk } A Chalk instance with the specified styles.
34
30
*/
35
- palette ( styles : string | string [ ] = [ ] , chain ?: Chalk ) : Chalk {
36
- console . log ( 'styles: ' , styles ) ;
31
+ palette ( styles : string | string [ ] = [ ] , chain ?: Chalk ) : Chalk {
37
32
const isArray = Array . isArray ( styles ) ;
38
33
const isIllegal = ! isArray && ! isString ( styles ) ;
39
34
@@ -67,7 +62,7 @@ export default class PaletteError extends Error {
67
62
* @param {string } [style] - The style to apply.
68
63
* @returns {Chalk } A Chalk instance with the specified style.
69
64
*/
70
- private factory ( chain : Chalk , style ?: string ) : Chalk {
65
+ private factory ( chain : Chalk , style ?: string ) : Chalk {
71
66
let nextChain ;
72
67
73
68
if ( ! isString ( style ) ) {
@@ -79,10 +74,7 @@ export default class PaletteError extends Error {
79
74
} else if ( isRgb ( style ) ) {
80
75
nextChain = chain . rgb ( ...normalizeRgb ( style ) ) ;
81
76
} else if ( isBgHex ( style ) ) {
82
- nextChain =
83
- chain . bgHex ( (
84
- style as string
85
- ) . replace ( / ^ b g : / , '' ) ) ;
77
+ nextChain = chain . bgHex ( ( style as string ) . replace ( / ^ b g : / , '' ) ) ;
86
78
} else if ( isHex ( style ) ) {
87
79
nextChain = chain . hex ( style ) ;
88
80
} else {
0 commit comments