Skip to content

Commit 502bc95

Browse files
committed
fix: clean debug log
1 parent 1caab0e commit 502bc95

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/core/PaletteError.ts

+5-13
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@ export default class PaletteError extends Error {
1212
* @constructor
1313
* @param {(string | Error)} message - The error message or an Error object.
1414
*/
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));
2117

2218
/**
2319
* The name of the error.
@@ -32,8 +28,7 @@ export default class PaletteError extends Error {
3228
* @param {Chalk} [chain] - The Chalk instance to chain with.
3329
* @returns {Chalk} A Chalk instance with the specified styles.
3430
*/
35-
palette (styles: string | string[] = [], chain?: Chalk): Chalk {
36-
console.log('styles: ', styles);
31+
palette(styles: string | string[] = [], chain?: Chalk): Chalk {
3732
const isArray = Array.isArray(styles);
3833
const isIllegal = !isArray && !isString(styles);
3934

@@ -67,7 +62,7 @@ export default class PaletteError extends Error {
6762
* @param {string} [style] - The style to apply.
6863
* @returns {Chalk} A Chalk instance with the specified style.
6964
*/
70-
private factory (chain: Chalk, style?: string): Chalk {
65+
private factory(chain: Chalk, style?: string): Chalk {
7166
let nextChain;
7267

7368
if (!isString(style)) {
@@ -79,10 +74,7 @@ export default class PaletteError extends Error {
7974
} else if (isRgb(style)) {
8075
nextChain = chain.rgb(...normalizeRgb(style));
8176
} else if (isBgHex(style)) {
82-
nextChain =
83-
chain.bgHex((
84-
style as string
85-
).replace(/^bg:/, ''));
77+
nextChain = chain.bgHex((style as string).replace(/^bg:/, ''));
8678
} else if (isHex(style)) {
8779
nextChain = chain.hex(style);
8880
} else {

0 commit comments

Comments
 (0)