UNPKG

code-story

Version:

Get your code activity log for standup from git

28 lines (27 loc) 1.22 kB
"use strict"; var _a; Object.defineProperty(exports, "__esModule", { value: true }); var chalk_1 = require("chalk"); var constants_1 = require("src/constants"); var COLOR_MAP = (_a = {}, _a[constants_1.TextEntity.url] = chalk_1.blue, _a[constants_1.TextEntity.label] = chalk_1.cyan, _a[constants_1.TextEntity.repositoryName] = chalk_1.cyan, _a[constants_1.TextEntity.branch] = chalk_1.magenta.bold, _a[constants_1.TextEntity.date] = chalk_1.dim, _a[constants_1.TextEntity.commitSubject] = chalk_1.white, _a[constants_1.TextEntity.addedFile] = chalk_1.green, _a[constants_1.TextEntity.deletedFile] = chalk_1.red, _a[constants_1.TextEntity.modifiedFile] = chalk_1.yellow, _a[constants_1.TextEntity.addedCommit] = chalk_1.green, _a[constants_1.TextEntity.modifiedCommit] = chalk_1.yellow, _a[constants_1.TextEntity.author] = chalk_1.yellow, /** * Not tested colors */ _a[constants_1.TextEntity.commitHash] = chalk_1.red, _a[constants_1.TextEntity.rebasedFile] = chalk_1.dim, _a[constants_1.TextEntity.nope] = chalk_1.white, _a); var chalkTextEntity = function (entity, text) { return COLOR_MAP[entity](text); }; exports.default = chalkTextEntity;