{"version":3,"file":"color-console.mjs","sources":["../../src/util/color-console.ts"],"sourcesContent":["import chalk from 'chalk'\n\ntype ColorFn = (text: string) => string\n\nconst createColorFormatter =\n  (textColor: ColorFn, argColor: ColorFn, consoleFn: 'log' | 'error' | 'info' | 'warn') =>\n  (textParts: TemplateStringsArray, ...args: unknown[]): void => {\n    // eslint-disable-next-line no-console\n    console[consoleFn](\n      textParts\n        .flatMap((t, i) => (args.length > i ? [textColor(t), argColor(`${args[i]}`)] : textColor(t)))\n        .reduce((acc, cur) => acc + cur, ''),\n    )\n  }\n\nexport const colorConsole = {\n  info: createColorFormatter(chalk.cyan, chalk.blue, 'info'),\n  warn: createColorFormatter(chalk.yellow, chalk.yellow.bold, 'warn'),\n  success: createColorFormatter(chalk.green, chalk.green.bold, 'info'),\n  error: createColorFormatter(chalk.red, chalk.red.bold, 'error'),\n}\n"],"names":[],"mappings":";;AAIA,MAAM,oBAAoB,GACxB,CAAC,SAAkB,EAAE,QAAiB,EAAE,SAA4C,KACpF,CAAC,SAA+B,EAAE,GAAG,IAAe,KAAU;;AAE5D,IAAA,OAAO,CAAC,SAAS,CAAC,CAChB;AACG,SAAA,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC3F,SAAA,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,GAAG,EAAE,EAAE,CAAC,CACvC;AACH,CAAC;AAEI,MAAM,YAAY,GAAG;AAC1B,IAAA,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC;AAC1D,IAAA,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;AACnE,IAAA,OAAO,EAAE,oBAAoB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC;AACpE,IAAA,KAAK,EAAE,oBAAoB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC;;;;;"}