How to use the turbo-git-config.parser.getCommitConf function in turbo-git-config

To help you get started, we’ve selected a few turbo-git-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github labs-js / turbo-git / lib / commands / log.js View on Github external
function parseLog(gitLogFull, gitLogTitles) {
        var commitConf = configParser.getCommitConf();

        function getRegex(tag) {
            return new RegExp(escapeSpecialCharactersRegex(tag) + '.*$', 'mg');
        }

        function getRegexMatch(gitLog, regex) {
            return gitLog.match(regex);
        }

        commitConf.forEach(function (prop) {
            var ArrayCommitsType = getRegexMatch(gitLogTitles, getRegex(prop.tag)) || [];

            ArrayCommitsType.forEach(function (commitMsg) {
                gitLogFull = gitLogFull.replace(getRegex(commitMsg), colors[prop.color](commitMsg));
            });
        });