Files
openpanel/packages/cli/src/utils/text/index.ts
Stefan Pejcic 09f9f9502d packages
2024-11-07 19:03:37 +01:00

12 lines
407 B
TypeScript

export const uppercaseFirstChar = (str: string): string => {
return str.charAt(0).toUpperCase() + str.slice(1);
};
export const removeANSIColors = (str: string): string => {
return str.replace(
// biome-ignore lint/suspicious/noControlCharactersInRegex: we want to remove invisible characters here.
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
"",
);
};