mirror of
https://github.com/tutao/tutanota.git
synced 2025-10-19 16:03:43 +00:00

close pi#214 Calendar only needs access to MailboxModel, MailModel handles deleting and moving mails
19 lines
458 B
TypeScript
19 lines
458 B
TypeScript
export const ansiSequences = Object.freeze({
|
|
redFg: "\x1b[31m",
|
|
greenBg: "\x1b[42m",
|
|
redBg: "\x1b[41m",
|
|
yellowBg: "\x1b[43m",
|
|
reset: "\x1b[0m",
|
|
bold: "\x1b[0;1m",
|
|
faint: "\x1b[0;2m",
|
|
})
|
|
|
|
type CodeValues = typeof ansiSequences[keyof typeof ansiSequences]
|
|
|
|
export function fancy(text: string, code: CodeValues) {
|
|
if (typeof process !== "undefined" && process.stdout.isTTY) {
|
|
return `${code}${text}${ansiSequences.reset}`
|
|
} else {
|
|
return text
|
|
}
|
|
}
|