smartlog-destination-devtools/.cache/f7/cab7621674640715b26d49a86cb06c.json
2018-11-13 01:32:39 +01:00

1 line
6.4 KiB
JSON

{"id":"node_modules/@pushrocks/consolecolor/dist/index.js","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/@pushrocks/consolecolor/ts/index.ts","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/package.json","includedInParent":true,"mtime":1542067438335},{"name":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/@pushrocks/consolecolor/package.json","includedInParent":true,"mtime":1542058764034},{"name":"ansi-256-colors","loc":{"line":3,"column":27},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/@pushrocks/consolecolor/dist/index.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/ansi-256-colors/index.js"}],"generated":{"js":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ansiColors = require(\"ansi-256-colors\");\n/**\n * the color translator function\n */\nlet colorTranslator = (colorArg) => {\n switch (colorArg) {\n case 'black':\n return { r: 0, g: 0, b: 0 };\n case 'blue':\n return { r: 0, g: 2, b: 5 };\n case 'brown':\n return { r: 1, g: 0, b: 0 };\n case 'cyan':\n return { r: 2, g: 4, b: 4 };\n case 'green':\n return { r: 2, g: 4, b: 1 };\n case 'orange':\n return { r: 5, g: 3, b: 1 };\n case 'pink':\n return { r: 3, g: 2, b: 4 };\n case 'red':\n return { r: 5, g: 0, b: 0 };\n case 'white':\n return { r: 5, g: 5, b: 5 };\n default:\n return { r: 5, g: 5, b: 5 };\n }\n};\n/**\n * colors the font of a string\n */\nlet coloredFont = (stringArg, colorArg) => {\n let rgbCode = colorTranslator(colorArg);\n return ansiColors.fg.getRgb(rgbCode.r, rgbCode.g, rgbCode.b) + stringArg;\n};\n/**\n * colors the back of a string\n */\nlet coloredBackground = (stringArg, colorArg) => {\n let rgbCode = colorTranslator(colorArg);\n return ansiColors.bg.getRgb(rgbCode.r, rgbCode.g, rgbCode.b) + stringArg;\n};\n/**\n * color a string with xterm\n */\nexports.coloredString = (stringArg, colorFontArg, colorBackgroundArg) => {\n let returnString = coloredFont(stringArg, colorFontArg);\n if (colorBackgroundArg) {\n returnString = coloredBackground(returnString, colorBackgroundArg);\n }\n returnString = returnString + ansiColors.reset;\n return returnString;\n};\n","map":{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;AAAA,8CAA8C;AAsB9C;;GAEG;AACH,IAAI,eAAe,GAAG,CAAC,QAAoB,EAAQ,EAAE;IACnD,QAAQ,QAAQ,EAAE;QAChB,KAAK,OAAO;YACV,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9B,KAAK,MAAM;YACT,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9B,KAAK,OAAO;YACV,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9B,KAAK,MAAM;YACT,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9B,KAAK,OAAO;YACV,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9B,KAAK,QAAQ;YACX,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9B,KAAK,MAAM;YACT,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,C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,UAAU,CAAC,KAAK,CAAC;IAC/C,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC","sourcesContent":["import * as ansiColors from 'ansi-256-colors';\n\n/**\n * all the color names that are available for proper xterm translation\n */\nexport type TColorName =\n | 'black'\n | 'blue'\n | 'brown'\n | 'cyan'\n | 'green'\n | 'orange'\n | 'pink'\n | 'red'\n | 'white';\n\nexport interface IRGB {\n r: number;\n b: number;\n g: number;\n}\n\n/**\n * the color translator function\n */\nlet colorTranslator = (colorArg: TColorName): IRGB => {\n switch (colorArg) {\n case 'black':\n return { r: 0, g: 0, b: 0 };\n case 'blue':\n return { r: 0, g: 2, b: 5 };\n case 'brown':\n return { r: 1, g: 0, b: 0 };\n case 'cyan':\n return { r: 2, g: 4, b: 4 };\n case 'green':\n return { r: 2, g: 4, b: 1 };\n case 'orange':\n return { r: 5, g: 3, b: 1 };\n case 'pink':\n return { r: 3, g: 2, b: 4 };\n case 'red':\n return { r: 5, g: 0, b: 0 };\n case 'white':\n return { r: 5, g: 5, b: 5 };\n default:\n return { r: 5, g: 5, b: 5 };\n }\n};\n\n/**\n * colors the font of a string\n */\nlet coloredFont = (stringArg: string, colorArg: TColorName) => {\n let rgbCode: IRGB = colorTranslator(colorArg);\n return ansiColors.fg.getRgb(rgbCode.r, rgbCode.g, rgbCode.b) + stringArg;\n};\n\n/**\n * colors the back of a string\n */\nlet coloredBackground = (stringArg: string, colorArg: TColorName) => {\n let rgbCode = colorTranslator(colorArg);\n return ansiColors.bg.getRgb(rgbCode.r, rgbCode.g, rgbCode.b) + stringArg;\n};\n\n/**\n * color a string with xterm\n */\nexport let coloredString = (\n stringArg: string,\n colorFontArg: TColorName,\n colorBackgroundArg?: TColorName\n): string => {\n let returnString = coloredFont(stringArg, colorFontArg);\n if (colorBackgroundArg) {\n returnString = coloredBackground(returnString, colorBackgroundArg);\n }\n returnString = returnString + ansiColors.reset;\n return returnString;\n};\n"]}},"hash":"5e7085d6e6a096aaf13f35d37b5fea84","cacheData":{"env":{}}}