Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
32 lines
831 B
Plaintext
32 lines
831 B
Plaintext
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.DEFAULT_COLOR_MAP = void 0;
|
|
exports.DEFAULT_COLOR_MAP = {
|
|
red: '\x1b[31m',
|
|
green: '\x1b[32m',
|
|
yellow: '\x1b[33m',
|
|
blue: '\x1b[34m',
|
|
magenta: '\x1b[35m',
|
|
cyan: '\x1b[36m',
|
|
white: '\x1b[37m',
|
|
white_bold: '\x1b[01m',
|
|
reset: '\x1b[0m',
|
|
};
|
|
class ColoredConsoleLine {
|
|
constructor(colorMap = exports.DEFAULT_COLOR_MAP) {
|
|
this.text = '';
|
|
this.colorMap = colorMap;
|
|
}
|
|
addCharsWithColor(color, text) {
|
|
const colorAnsi = this.colorMap[color];
|
|
this.text +=
|
|
colorAnsi !== undefined
|
|
? `${colorAnsi}${text}${this.colorMap.reset}`
|
|
: text;
|
|
}
|
|
renderConsole() {
|
|
return this.text;
|
|
}
|
|
}
|
|
exports.default = ColoredConsoleLine;
|