Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): replace cli-color dep with colorette #117

Merged
merged 7 commits into from Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
// -----------------------------------------------------------------------------

import { format } from 'util';
import clc from 'cli-color';
import {
blue as coloretteBlue,
italic as coloretteItalic,
red as coloretteRed,
underline as coloretteUnderline,
yellow as coloretteYellow,
} from 'colorette';
import hasUnicode from 'has-unicode';
import supportsAnsi from 'supports-ansi';

Expand All @@ -30,7 +36,7 @@ export const UnicodeEscapes = {
* @returns {string}
*/
export function blueify(text:string):string {
return supportsAnsi ? clc.blue(text) : text;
return supportsAnsi ? coloretteBlue(text) : text;
}

/**
Expand Down Expand Up @@ -63,7 +69,7 @@ export function ellipsify(text:string):string {
* @returns {string}
*/
export function italicize(text:string):string {
return supportsAnsi ? clc.italic(text) : text;
return supportsAnsi ? coloretteItalic(text) : text;
}

/**
Expand All @@ -88,7 +94,7 @@ export function mdCodeSpans2html(text:string):string {
* @returns {string}
*/
export function redden(text:string):string {
return supportsAnsi ? clc.red(text) : text;
return supportsAnsi ? coloretteRed(text) : text;
}

/**
Expand All @@ -97,7 +103,7 @@ export function redden(text:string):string {
* @returns {string}
*/
export function underline(text:string):string {
return supportsAnsi ? clc.underline(text) : text;
return supportsAnsi ? coloretteUnderline(text) : text;
}

/**
Expand All @@ -106,5 +112,5 @@ export function underline(text:string):string {
* @returns {string}
*/
export function yellow(text:string):string {
return supportsAnsi ? clc.yellow(text) : text;
return supportsAnsi ? coloretteYellow(text) : text;
}
Loading