UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

29 lines (26 loc) 1.2 kB
import { getGitCurBranch } from '../git/git.mjs'; import '../tslib.es6-096fffdd.js'; import '../node/node-command.mjs'; import '@babel/runtime/helpers/typeof'; var genTitle = function genTitle(prefix, checkAll, name) { if (name === void 0) { name = 'LINT'; } return "".concat(prefix).concat(checkAll ? "\u3010".concat(name, "\u3011\u5168\u91CF\u6A21\u5F0F") : "\u3010".concat(name, "\u3011\u589E\u91CF\u6A21\u5F0F")); }; var genReportInfo = function genReportInfo(_a) { var workspace = _a.workspace, mrUrl = _a.mrUrl, sourceBranch = _a.sourceBranch, targetBranch = _a.targetBranch, repo = _a.repo, repoUrl = _a.repoUrl, _b = _a.checkAll, checkAll = _b === void 0 ? false : _b; var curBranch = getGitCurBranch(workspace, false); var repoAndMrInfo = [mrUrl ? "[".concat(mrUrl, "](").concat(mrUrl, ")") : '', sourceBranch && targetBranch ? "".concat(sourceBranch, " => ").concat(targetBranch) : '', checkAll && repo && repoUrl ? "[".concat(repo, "](").concat(repoUrl, ")") : '', checkAll && curBranch ? "\u5206\u652F: ".concat(curBranch) : ''].filter(function (item) { return item; }); return repoAndMrInfo; }; export { genReportInfo, genTitle };