UNPKG

@zombienet/utils

Version:

Useful utilities for ZombieNet Framework

39 lines (38 loc) 942 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.decorators = void 0; const reset = "\x1b[0m"; const colorMap = { reset: "\x1b[0m", bright: "\x1b[1m", dim: "\x1b[2m", underscore: "\x1b[4m", blink: "\x1b[5m", reverse: "\x1b[7m", hidden: "\x1b[8m", //colors black: "\x1b[30m", red: "\x1b[31m", green: "\x1b[32m", yellow: "\x1b[33m", blue: "\x1b[34m", magenta: "\x1b[35m", cyan: "\x1b[36m", white: "\x1b[37m", // background colors bg_black: "\x1b[40m", bg_red: "\x1b[41m", bg_green: "\x1b[42m", bg_yellow: "\x1b[43m", bg_blue: "\x1b[44m", bg_magenta: "\x1b[45m", bg_cyan: "\x1b[46m", bg_white: "\x1b[47m", }; const colorFns = {}; for (const [color, code] of Object.entries(colorMap)) { colorFns[color] = function (input) { return `${code}${input}${reset}`; }; } exports.decorators = colorFns;