1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.formatError = exports.getOutPath = void 0;
|
4 | const tslib_1 = require("tslib");
|
5 | const path_1 = tslib_1.__importDefault(require("path"));
|
6 | const colorette_1 = tslib_1.__importDefault(require("colorette"));
|
7 |
|
8 | function getOutPath(inDir, fPath, outDir) {
|
9 | return path_1.default.join(outDir, path_1.default.relative(inDir, path_1.default.dirname(fPath)));
|
10 | }
|
11 | exports.getOutPath = getOutPath;
|
12 |
|
13 | function formatError({ file, line, column, tool, message, code }) {
|
14 | return `${colorette_1.default.cyanBright(path_1.default.relative(process.env.INIT_CWD || process.cwd(), file))}:${colorette_1.default.yellowBright(line)}:${colorette_1.default.yellowBright(column)} - ${colorette_1.default.redBright('error')} ${colorette_1.default.dim(tool)}: ${message.trim()}\n${code.trim()}`;
|
15 | }
|
16 | exports.formatError = formatError;
|
17 |
|
\ | No newline at end of file |