UNPKG

git-digger

Version:

![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/robertfmurdock/ze-great-tools?label=Release) ![NPM Version](https://img.shields.io/npm/v/git-digger?label=npm%20git-digger)

628 lines (626 loc) 25.8 kB
(function (_, kotlin_kotlin, kotlin_com_zegreatrob_tools_digger_model) { 'use strict'; //region block: imports var imul = Math.imul; var HashSet_init_$Create$ = kotlin_kotlin.$_$.l; var ArrayList_init_$Create$ = kotlin_kotlin.$_$.h; var Unit_instance = kotlin_kotlin.$_$.z2; var collectionSizeOrDefault = kotlin_kotlin.$_$.v3; var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.g; var to = kotlin_kotlin.$_$.hc; var firstOrNull = kotlin_kotlin.$_$.f4; var Pair = kotlin_kotlin.$_$.gb; var listOf = kotlin_kotlin.$_$.w4; var checkIndexOverflow = kotlin_kotlin.$_$.u3; var getOrNull = kotlin_kotlin.$_$.j4; var plus = kotlin_kotlin.$_$.h5; var emptyList = kotlin_kotlin.$_$.c4; var plus_0 = kotlin_kotlin.$_$.i5; var last = kotlin_kotlin.$_$.t4; var toString = kotlin_kotlin.$_$.e8; var toString_0 = kotlin_kotlin.$_$.gc; var protoOf = kotlin_kotlin.$_$.c8; var getStringHashCode = kotlin_kotlin.$_$.c7; var hashCode = kotlin_kotlin.$_$.d7; var equals = kotlin_kotlin.$_$.y6; var initMetadataForClass = kotlin_kotlin.$_$.e7; var lastOrNull = kotlin_kotlin.$_$.s4; var maxOrNull = kotlin_kotlin.$_$.a5; var Contribution = kotlin_com_zegreatrob_tools_digger_model.$_$.a; var listOf_0 = kotlin_kotlin.$_$.x4; var addAll = kotlin_kotlin.$_$.n3; var toSet = kotlin_kotlin.$_$.b6; var sorted = kotlin_kotlin.$_$.q5; var toList = kotlin_kotlin.$_$.x5; var joinToString = kotlin_kotlin.$_$.n4; var Regex_init_$Create$ = kotlin_kotlin.$_$.p; var initMetadataForObject = kotlin_kotlin.$_$.j7; var VOID = kotlin_kotlin.$_$.c; var take = kotlin_kotlin.$_$.t5; var RegexOption_IGNORE_CASE_getInstance = kotlin_kotlin.$_$.d; var Regex_init_$Create$_0 = kotlin_kotlin.$_$.q; var RuntimeException_init_$Create$ = kotlin_kotlin.$_$.d1; var contains = kotlin_kotlin.$_$.n9; var mapOf = kotlin_kotlin.$_$.z4; var RegexOption_MULTILINE_getInstance = kotlin_kotlin.$_$.e; var setOf = kotlin_kotlin.$_$.m5; var Regex = kotlin_kotlin.$_$.k9; var firstOrNull_0 = kotlin_kotlin.$_$.r9; var lastIndexOf = kotlin_kotlin.$_$.z9; var substring = kotlin_kotlin.$_$.ma; var Char = kotlin_kotlin.$_$.ya; var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.g1; var mapNotNull = kotlin_kotlin.$_$.e9; var toList_0 = kotlin_kotlin.$_$.j9; var maxOrNull_0 = kotlin_kotlin.$_$.g9; var get = kotlin_kotlin.$_$.t9; var toIntOrNull = kotlin_kotlin.$_$.oa; var Companion_instance = kotlin_kotlin.$_$.u2; var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.j1; var createFailure = kotlin_kotlin.$_$.xb; var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.m1; var THROW_CCE = kotlin_kotlin.$_$.jb; var _Result___get_isFailure__impl__jpiriv = kotlin_kotlin.$_$.k1; var Enum = kotlin_kotlin.$_$.bb; //endregion //region block: pre-declaration initMetadataForClass(CommitInspectionResult, 'CommitInspectionResult'); initMetadataForObject(Defaults, 'Defaults'); initMetadataForClass(DiggerCore, 'DiggerCore'); initMetadataForClass(MessageDigResult, 'MessageDigResult'); initMetadataForObject(Defaults_0, 'Defaults'); initMetadataForClass(MessageDigger, 'MessageDigger', MessageDigger); initMetadataForClass(SemverType, 'SemverType', VOID, Enum); //endregion function allContributionCommits(_this__u8e3s4, tagRefs, fullLog) { // Inline function 'kotlin.collections.distinctBy' call var set = HashSet_init_$Create$(); var list = ArrayList_init_$Create$(); var _iterator__ex2g4s = tagRefs.o(); while (_iterator__ex2g4s.p()) { var e = _iterator__ex2g4s.q(); var key = e.ik_1; if (set.g(key)) { list.g(e); } } // Inline function 'kotlin.collections.filter' call // Inline function 'kotlin.collections.filterTo' call var destination = ArrayList_init_$Create$(); var _iterator__ex2g4s_0 = list.o(); while (_iterator__ex2g4s_0.p()) { var element = _iterator__ex2g4s_0.q(); // Inline function 'kotlin.collections.map' call // Inline function 'kotlin.collections.mapTo' call var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(fullLog, 10)); var _iterator__ex2g4s_1 = fullLog.o(); while (_iterator__ex2g4s_1.p()) { var item = _iterator__ex2g4s_1.q(); var tmp$ret$2 = item.sj_1; destination_0.g(tmp$ret$2); } if (destination_0.f1(element.ik_1)) { destination.g(element); } } return sortIntoTagSets(_this__u8e3s4, destination, fullLog); } function sortIntoTagSets(_this__u8e3s4, tagRefs, log) { // Inline function 'kotlin.collections.map' call var this_0 = tagPairs(tagRefs); // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10)); var _iterator__ex2g4s = this_0.o(); while (_iterator__ex2g4s.p()) { var item = _iterator__ex2g4s.q(); var earlierTag = item.i9(); var nextTag = item.j9(); var tmp; if (earlierTag == null && !(nextTag == null)) { tmp = _this__u8e3s4.fk('^' + nextTag.ik_1, 'HEAD'); } else if (!(earlierTag == null) && !(nextTag == null)) { tmp = _this__u8e3s4.fk('^' + nextTag.ik_1, earlierTag.ik_1); } else if (!(earlierTag == null)) { tmp = _this__u8e3s4.gk(earlierTag.ik_1); } else { tmp = alwaysLeftParent(log); } var tmp$ret$0 = to(earlierTag, tmp); destination.g(tmp$ret$0); } // Inline function 'kotlin.collections.filter' call // Inline function 'kotlin.collections.filterTo' call var destination_0 = ArrayList_init_$Create$(); var _iterator__ex2g4s_0 = destination.o(); while (_iterator__ex2g4s_0.p()) { var element = _iterator__ex2g4s_0.q(); // Inline function 'kotlin.collections.isNotEmpty' call if (!element.h9_1.l()) { destination_0.g(element); } } return destination_0; } function tagPairs(_this__u8e3s4) { var tmp = listOf(new Pair(null, firstOrNull(_this__u8e3s4))); // Inline function 'kotlin.collections.mapIndexed' call // Inline function 'kotlin.collections.mapIndexedTo' call var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(_this__u8e3s4, 10)); var index = 0; var _iterator__ex2g4s = _this__u8e3s4.o(); while (_iterator__ex2g4s.p()) { var item = _iterator__ex2g4s.q(); var _unary__edvuaz = index; index = _unary__edvuaz + 1 | 0; var index_0 = checkIndexOverflow(_unary__edvuaz); var tmp$ret$0 = to(item, getOrNull(_this__u8e3s4, index_0 + 1 | 0)); destination.g(tmp$ret$0); } return plus(tmp, destination); } function alwaysLeftParent(_this__u8e3s4) { // Inline function 'kotlin.collections.fold' call var accumulator = emptyList(); var _iterator__ex2g4s = _this__u8e3s4.o(); while (_iterator__ex2g4s.p()) { var element = _iterator__ex2g4s.q(); var acc = accumulator; var tmp; if (acc.l()) { tmp = plus_0(acc, element); } else if (element.sj_1 === firstOrNull(last(acc).wj_1)) { tmp = plus_0(acc, element); } else { tmp = acc; } accumulator = tmp; } return accumulator; } function CommitInspectionResult(storyId, ease, authors, semver) { this.yk_1 = storyId; this.zk_1 = ease; this.al_1 = authors; this.bl_1 = semver; } protoOf(CommitInspectionResult).toString = function () { return 'CommitInspectionResult(storyId=' + this.yk_1 + ', ease=' + this.zk_1 + ', authors=' + toString(this.al_1) + ', semver=' + toString_0(this.bl_1) + ')'; }; protoOf(CommitInspectionResult).hashCode = function () { var result = this.yk_1 == null ? 0 : getStringHashCode(this.yk_1); result = imul(result, 31) + (this.zk_1 == null ? 0 : this.zk_1) | 0; result = imul(result, 31) + hashCode(this.al_1) | 0; result = imul(result, 31) + (this.bl_1 == null ? 0 : this.bl_1.hashCode()) | 0; return result; }; protoOf(CommitInspectionResult).equals = function (other) { if (this === other) return true; if (!(other instanceof CommitInspectionResult)) return false; if (!(this.yk_1 == other.yk_1)) return false; if (!(this.zk_1 == other.zk_1)) return false; if (!equals(this.al_1, other.al_1)) return false; if (!equals(this.bl_1, other.bl_1)) return false; return true; }; function contribution(_this__u8e3s4, commitRefs) { // Inline function 'kotlin.collections.map' call // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(commitRefs, 10)); var _iterator__ex2g4s = commitRefs.o(); while (_iterator__ex2g4s.p()) { var item = _iterator__ex2g4s.q(); var tmp$ret$0 = commitInspectionResult(item, _this__u8e3s4.il(item.xj_1)); destination.g(tmp$ret$0); } var messageDigResults = destination; var lastCommit = firstOrNull(commitRefs); var firstCommit = lastOrNull(commitRefs); var tmp1_elvis_lhs = lastCommit == null ? null : lastCommit.sj_1; var tmp7_lastCommit = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs; var tmp3_elvis_lhs = firstCommit == null ? null : firstCommit.sj_1; var tmp8_firstCommit = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs; var tmp9_authors = allAuthors(messageDigResults); var tmp10_dateTime = lastCommit == null ? null : lastCommit.vj_1; var tmp11_firstCommitDateTime = firstCommit == null ? null : firstCommit.vj_1; // Inline function 'kotlin.collections.mapNotNull' call // Inline function 'kotlin.collections.mapNotNullTo' call var destination_0 = ArrayList_init_$Create$(); // Inline function 'kotlin.collections.forEach' call var _iterator__ex2g4s_0 = messageDigResults.o(); while (_iterator__ex2g4s_0.p()) { var element = _iterator__ex2g4s_0.q(); var tmp0_safe_receiver = element.zk_1; if (tmp0_safe_receiver == null) null; else { // Inline function 'kotlin.let' call destination_0.g(tmp0_safe_receiver); } } var tmp12_ease = maxOrNull(destination_0); var tmp13_storyId = mergedStoryIds(messageDigResults); // Inline function 'kotlin.collections.mapNotNull' call // Inline function 'kotlin.collections.mapNotNullTo' call var destination_1 = ArrayList_init_$Create$(); // Inline function 'kotlin.collections.forEach' call var _iterator__ex2g4s_1 = messageDigResults.o(); while (_iterator__ex2g4s_1.p()) { var element_0 = _iterator__ex2g4s_1.q(); var tmp0_safe_receiver_0 = element_0.bl_1; if (tmp0_safe_receiver_0 == null) null; else { // Inline function 'kotlin.let' call destination_1.g(tmp0_safe_receiver_0); } } var tmp6_safe_receiver = highestPrioritySemver(destination_1); var tmp14_semver = tmp6_safe_receiver == null ? null : tmp6_safe_receiver.toString(); // Inline function 'kotlin.collections.count' call var tmp15_commitCount = commitRefs.s(); return new Contribution(tmp7_lastCommit, tmp8_firstCommit, tmp9_authors, tmp15_commitCount, tmp10_dateTime, tmp11_firstCommitDateTime, tmp12_ease, tmp13_storyId, tmp14_semver, null, null, null); } function commitInspectionResult(_this__u8e3s4, digResult) { return new CommitInspectionResult(digResult.jl_1, digResult.kl_1, plus(listOf_0([_this__u8e3s4.uj_1, _this__u8e3s4.tj_1]), digResult.ll_1), digResult.ml_1); } function allAuthors(messageDigResults) { // Inline function 'kotlin.collections.flatMap' call // Inline function 'kotlin.collections.flatMapTo' call var destination = ArrayList_init_$Create$(); var _iterator__ex2g4s = messageDigResults.o(); while (_iterator__ex2g4s.p()) { var element = _iterator__ex2g4s.q(); var list = element.al_1; addAll(destination, list); } // Inline function 'kotlin.collections.map' call // Inline function 'kotlin.collections.mapTo' call var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10)); var _iterator__ex2g4s_0 = destination.o(); while (_iterator__ex2g4s_0.p()) { var item = _iterator__ex2g4s_0.q(); // Inline function 'kotlin.text.lowercase' call // Inline function 'kotlin.js.asDynamic' call var tmp$ret$5 = item.toLowerCase(); destination_0.g(tmp$ret$5); } return toList(sorted(toSet(destination_0))); } function mergedStoryIds(messageDigResults) { // Inline function 'kotlin.collections.mapNotNull' call // Inline function 'kotlin.collections.mapNotNullTo' call var destination = ArrayList_init_$Create$(); // Inline function 'kotlin.collections.forEach' call var _iterator__ex2g4s = messageDigResults.o(); while (_iterator__ex2g4s.p()) { var element = _iterator__ex2g4s.q(); var tmp0_safe_receiver = element.yk_1; if (tmp0_safe_receiver == null) null; else { // Inline function 'kotlin.let' call destination.g(tmp0_safe_receiver); } } // Inline function 'kotlin.let' call var tmp; // Inline function 'kotlin.collections.isNotEmpty' call if (!destination.l()) { tmp = joinToString(sorted(toSet(destination)), ', '); } else { tmp = null; } return tmp; } function currentContributionCommits(_this__u8e3s4, previousTag) { var tmp; if (previousTag == null) { tmp = _this__u8e3s4.ek(); } else { tmp = _this__u8e3s4.fk('^' + previousTag.hk_1, 'HEAD'); } return tmp; } function tagRefs($this) { // Inline function 'kotlin.collections.filter' call var tmp0 = $this.ol_1.dk(); // Inline function 'kotlin.collections.filterTo' call var destination = ArrayList_init_$Create$(); var _iterator__ex2g4s = tmp0.o(); while (_iterator__ex2g4s.p()) { var element = _iterator__ex2g4s.q(); if ($this.ql_1.qb(element.hk_1)) { destination.g(element); } } return destination; } function currentRelevantTags($this, headCommitId, lastTwoTags) { // Inline function 'kotlin.let' call var latestTag = getOrNull(lastTwoTags, 0); var tmp; if ((latestTag == null ? null : latestTag.ik_1) === headCommitId) { tmp = to(latestTag, getOrNull(lastTwoTags, 1)); } else { tmp = to(null, latestTag); } return tmp; } function Defaults() { Defaults_instance = this; this.rl_1 = Regex_init_$Create$('.*'); } var Defaults_instance; function Defaults_getInstance() { if (Defaults_instance == null) new Defaults(); return Defaults_instance; } function DiggerCore(label, gitWrapper, messageDigger, tagRegex) { tagRegex = tagRegex === VOID ? Defaults_getInstance().rl_1 : tagRegex; this.nl_1 = label; this.ol_1 = gitWrapper; this.pl_1 = messageDigger; this.ql_1 = tagRegex; } protoOf(DiggerCore).sl = function () { // Inline function 'kotlin.with' call var $this$with = this.ol_1; var _destruct__k2r9zo = currentRelevantTags(this, $this$with.ck(), take(tagRefs(this), 2)); var currentTag = _destruct__k2r9zo.i9(); var previousTag = _destruct__k2r9zo.j9(); var tmp = contribution(this.pl_1, currentContributionCommits($this$with, previousTag)); var tmp_0 = currentTag == null ? null : currentTag.hk_1; return tmp.xk(VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, this.nl_1, tmp_0, currentTag == null ? null : currentTag.jk_1); }; protoOf(DiggerCore).tl = function () { // Inline function 'kotlin.collections.map' call var this_0 = allContributionCommits(this.ol_1, tagRefs(this), this.ol_1.ek()); // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10)); var _iterator__ex2g4s = this_0.o(); while (_iterator__ex2g4s.p()) { var item = _iterator__ex2g4s.q(); var tmp$ret$0 = to(item.g9_1, contribution(this.pl_1, toList(item.h9_1))); destination.g(tmp$ret$0); } // Inline function 'kotlin.collections.map' call // Inline function 'kotlin.collections.mapTo' call var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10)); var _iterator__ex2g4s_0 = destination.o(); while (_iterator__ex2g4s_0.p()) { var item_0 = _iterator__ex2g4s_0.q(); var tag = item_0.i9(); var contribution_0 = item_0.j9(); var tmp = tag == null ? null : tag.hk_1; var tmp$ret$3 = contribution_0.xk(VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, this.nl_1, tmp, tag == null ? null : tag.jk_1); destination_0.g(tmp$ret$3); } return destination_0; }; function MessageDigResult(storyId, ease, coauthors, semver) { this.jl_1 = storyId; this.kl_1 = ease; this.ll_1 = coauthors; this.ml_1 = semver; } protoOf(MessageDigResult).toString = function () { return 'MessageDigResult(storyId=' + this.jl_1 + ', ease=' + this.kl_1 + ', coauthors=' + toString(this.ll_1) + ', semver=' + toString_0(this.ml_1) + ')'; }; protoOf(MessageDigResult).hashCode = function () { var result = this.jl_1 == null ? 0 : getStringHashCode(this.jl_1); result = imul(result, 31) + (this.kl_1 == null ? 0 : this.kl_1) | 0; result = imul(result, 31) + hashCode(this.ll_1) | 0; result = imul(result, 31) + (this.ml_1 == null ? 0 : this.ml_1.hashCode()) | 0; return result; }; protoOf(MessageDigResult).equals = function (other) { if (this === other) return true; if (!(other instanceof MessageDigResult)) return false; if (!(this.jl_1 == other.jl_1)) return false; if (!(this.kl_1 == other.kl_1)) return false; if (!equals(this.ll_1, other.ll_1)) return false; if (!equals(this.ml_1, other.ml_1)) return false; return true; }; function Defaults_0() { Defaults_instance_0 = this; this.ul_1 = Regex_init_$Create$_0('\\[major\\]', RegexOption_IGNORE_CASE_getInstance()); this.vl_1 = Regex_init_$Create$_0('\\[minor\\]', RegexOption_IGNORE_CASE_getInstance()); this.wl_1 = Regex_init_$Create$_0('\\[patch\\]', RegexOption_IGNORE_CASE_getInstance()); this.xl_1 = Regex_init_$Create$_0('\\[none\\]', RegexOption_IGNORE_CASE_getInstance()); this.yl_1 = Regex_init_$Create$('\\[(?<storyId>.*?)\\]'); this.zl_1 = Regex_init_$Create$('-(?<ease>[1-5])-'); } var Defaults_instance_0; function Defaults_getInstance_0() { if (Defaults_instance_0 == null) new Defaults_0(); return Defaults_instance_0; } function MessageDigger(majorRegex, minorRegex, patchRegex, noneRegex, storyIdRegex, easeRegex) { majorRegex = majorRegex === VOID ? Defaults_getInstance_0().ul_1 : majorRegex; minorRegex = minorRegex === VOID ? Defaults_getInstance_0().vl_1 : minorRegex; patchRegex = patchRegex === VOID ? Defaults_getInstance_0().wl_1 : patchRegex; noneRegex = noneRegex === VOID ? Defaults_getInstance_0().xl_1 : noneRegex; storyIdRegex = storyIdRegex === VOID ? Defaults_getInstance_0().yl_1 : storyIdRegex; easeRegex = easeRegex === VOID ? Defaults_getInstance_0().zl_1 : easeRegex; if (!contains(storyIdRegex.kb_1, '?<storyId>')) { throw RuntimeException_init_$Create$('StoryIdRegex must include a storyId group. The regex was: ' + storyIdRegex.kb_1); } if (!contains(easeRegex.kb_1, '?<ease>')) { throw RuntimeException_init_$Create$('EaseRegex must include an ease group. The regex was: ' + easeRegex.kb_1); } this.cl_1 = mapOf([to('major', majorRegex), to('minor', minorRegex), to('patch', patchRegex), to('none', noneRegex)]); var tmp = this; // Inline function 'kotlin.collections.map' call var this_0 = this.cl_1; // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$_0(this_0.s()); // Inline function 'kotlin.collections.iterator' call var _iterator__ex2g4s = this_0.z().o(); while (_iterator__ex2g4s.p()) { var item = _iterator__ex2g4s.q(); // Inline function 'kotlin.collections.component1' call var group = item.a1(); // Inline function 'kotlin.collections.component2' call var regex = item.b1(); var tmp$ret$3 = '(?<' + group + '>' + cleaned(regex) + ')?'; destination.g(tmp$ret$3); } tmp.dl_1 = joinToString(destination, ''); this.el_1 = '(' + cleaned(storyIdRegex) + ')?'; this.fl_1 = '(' + cleaned(easeRegex) + ')?'; this.gl_1 = '(Co-authored-by: .* <(?<coAuthors>.*)>)?'; this.hl_1 = new Regex(this.dl_1 + this.el_1 + this.fl_1 + this.gl_1, setOf([RegexOption_IGNORE_CASE_getInstance(), RegexOption_MULTILINE_getInstance()])); } protoOf(MessageDigger).il = function (input) { return messageDigResult(this.hl_1.tb(input)); }; function cleaned(_this__u8e3s4) { var first = firstOrNull_0(_this__u8e3s4.kb_1); var last = lastIndexOf(_this__u8e3s4.kb_1, '/'); var tmp; var tmp_0 = first; if (equals(tmp_0 == null ? null : new Char(tmp_0), new Char(_Char___init__impl__6a9atx(47)))) { tmp = substring(_this__u8e3s4.kb_1, 1, last); } else { tmp = _this__u8e3s4.kb_1; } return tmp; } function messageDigResult(_this__u8e3s4) { var tmp3_coauthors = toList_0(mapNotNull(_this__u8e3s4, messageDigResult$lambda)); var tmp4_semver = maxOrNull_0(mapNotNull(_this__u8e3s4, messageDigResult$lambda_0)); var tmp$ret$1; $l$block: { // Inline function 'kotlin.sequences.firstNotNullOfOrNull' call var _iterator__ex2g4s = _this__u8e3s4.o(); while (_iterator__ex2g4s.p()) { var element = _iterator__ex2g4s.q(); var result = get(element.bc(), 'storyId'); if (!(result == null)) { tmp$ret$1 = result; break $l$block; } } tmp$ret$1 = null; } var tmp0_safe_receiver = tmp$ret$1; var tmp5_storyId = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.xb_1; var tmp$ret$3; $l$block_0: { // Inline function 'kotlin.sequences.firstNotNullOfOrNull' call var _iterator__ex2g4s_0 = _this__u8e3s4.o(); while (_iterator__ex2g4s_0.p()) { var element_0 = _iterator__ex2g4s_0.q(); var result_0 = get(element_0.bc(), 'ease'); if (!(result_0 == null)) { tmp$ret$3 = result_0; break $l$block_0; } } tmp$ret$3 = null; } var tmp1_safe_receiver = tmp$ret$3; var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.xb_1; var tmp6_ease = tmp2_safe_receiver == null ? null : toIntOrNull(tmp2_safe_receiver); return new MessageDigResult(tmp5_storyId, tmp6_ease, tmp3_coauthors, tmp4_semver); } function getSemver(it) { return groupMatches(it, 'major') ? SemverType_Major_getInstance() : groupMatches(it, 'minor') ? SemverType_Minor_getInstance() : groupMatches(it, 'patch') ? SemverType_Patch_getInstance() : groupMatches(it, 'none') ? SemverType_None_getInstance() : null; } function groupMatches(_this__u8e3s4, groupName) { // Inline function 'kotlin.runCatching' call var tmp; try { // Inline function 'kotlin.Companion.success' call var value = get(_this__u8e3s4.bc(), groupName); tmp = _Result___init__impl__xyqfz8(value); } catch ($p) { var tmp_0; if ($p instanceof Error) { var e = $p; // Inline function 'kotlin.Companion.failure' call tmp_0 = _Result___init__impl__xyqfz8(createFailure(e)); } else { throw $p; } tmp = tmp_0; } // Inline function 'kotlin.Result.getOrNull' call var this_0 = tmp; var tmp_1; if (_Result___get_isFailure__impl__jpiriv(this_0)) { tmp_1 = null; } else { var tmp_2 = _Result___get_value__impl__bjfvqg(this_0); tmp_1 = (tmp_2 == null ? true : !(tmp_2 == null)) ? tmp_2 : THROW_CCE(); } return !(tmp_1 == null); } function highestPrioritySemver(_this__u8e3s4) { return maxOrNull(_this__u8e3s4); } function messageDigResult$lambda(it) { var tmp0_safe_receiver = get(it.bc(), 'coAuthors'); return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.xb_1; } function messageDigResult$lambda_0(it) { return getSemver(it); } var SemverType_None_instance; var SemverType_Patch_instance; var SemverType_Minor_instance; var SemverType_Major_instance; var SemverType_entriesInitialized; function SemverType_initEntries() { if (SemverType_entriesInitialized) return Unit_instance; SemverType_entriesInitialized = true; SemverType_None_instance = new SemverType('None', 0); SemverType_Patch_instance = new SemverType('Patch', 1); SemverType_Minor_instance = new SemverType('Minor', 2); SemverType_Major_instance = new SemverType('Major', 3); } function SemverType(name, ordinal) { Enum.call(this, name, ordinal); } function SemverType_None_getInstance() { SemverType_initEntries(); return SemverType_None_instance; } function SemverType_Patch_getInstance() { SemverType_initEntries(); return SemverType_Patch_instance; } function SemverType_Minor_getInstance() { SemverType_initEntries(); return SemverType_Minor_instance; } function SemverType_Major_getInstance() { SemverType_initEntries(); return SemverType_Major_instance; } //region block: exports _.$_$ = _.$_$ || {}; _.$_$.a = DiggerCore; _.$_$.b = MessageDigger; _.$_$.c = Defaults_getInstance; _.$_$.d = Defaults_getInstance_0; //endregion return _; }(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./tools-digger-model.js'))); //# sourceMappingURL=tools-digger-core.js.map