-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
Remove kleur and use Node.js styleText with the following implementation:
// Import Node.js Dependencies
import {
styleText,
type InspectColorForeground,
type InspectColorBackground,
type InspectColorModifier
} from "node:util";
type StyleName = InspectColorForeground | InspectColorBackground | InspectColorModifier;
type Formatter = {
(text: string): string;
} & {
[K in StyleName]: Formatter;
};
function createFormatter(styles: StyleName[] = []): Formatter {
return new Proxy(
(text: string) => styleText(styles, text),
{
get: (_, prop: string) => createFormatter([...styles, prop as StyleName])
}
) as Formatter;
}
const formatter = createFormatter();
export default formatter;Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers