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)

630 lines (628 loc) 26.1 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.$_$.p; var ArrayList_init_$Create$ = kotlin_kotlin.$_$.l; var Unit_instance = kotlin_kotlin.$_$.d3; var collectionSizeOrDefault = kotlin_kotlin.$_$.z3; var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.k; var to = kotlin_kotlin.$_$.hc; var firstOrNull = kotlin_kotlin.$_$.j4; var Pair = kotlin_kotlin.$_$.gb; var listOf = kotlin_kotlin.$_$.a5; var checkIndexOverflow = kotlin_kotlin.$_$.y3; var getOrNull = kotlin_kotlin.$_$.n4; var plus = kotlin_kotlin.$_$.l5; var emptyList = kotlin_kotlin.$_$.g4; var plus_0 = kotlin_kotlin.$_$.m5; var last = kotlin_kotlin.$_$.x4; var toString = kotlin_kotlin.$_$.i8; var toString_0 = kotlin_kotlin.$_$.gc; var protoOf = kotlin_kotlin.$_$.f8; var getStringHashCode = kotlin_kotlin.$_$.f7; var hashCode = kotlin_kotlin.$_$.g7; var THROW_CCE = kotlin_kotlin.$_$.jb; var equals = kotlin_kotlin.$_$.b7; var initMetadataForClass = kotlin_kotlin.$_$.h7; var lastOrNull = kotlin_kotlin.$_$.w4; var maxOrNull = kotlin_kotlin.$_$.e5; var Contribution = kotlin_com_zegreatrob_tools_digger_model.$_$.a; var listOf_0 = kotlin_kotlin.$_$.b5; var addAll = kotlin_kotlin.$_$.r3; var toSet = kotlin_kotlin.$_$.f6; var sorted = kotlin_kotlin.$_$.u5; var toList = kotlin_kotlin.$_$.b6; var joinToString = kotlin_kotlin.$_$.r4; var Regex_init_$Create$ = kotlin_kotlin.$_$.t; var initMetadataForObject = kotlin_kotlin.$_$.m7; var VOID = kotlin_kotlin.$_$.g; var take = kotlin_kotlin.$_$.x5; var RegexOption_IGNORE_CASE_getInstance = kotlin_kotlin.$_$.h; var Regex_init_$Create$_0 = kotlin_kotlin.$_$.u; var RuntimeException_init_$Create$ = kotlin_kotlin.$_$.h1; var contains = kotlin_kotlin.$_$.n9; var mapOf = kotlin_kotlin.$_$.d5; var RegexOption_MULTILINE_getInstance = kotlin_kotlin.$_$.i; var setOf = kotlin_kotlin.$_$.q5; 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.$_$.k1; 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.$_$.y2; var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.n1; var createFailure = kotlin_kotlin.$_$.xb; var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.q1; var _Result___get_isFailure__impl__jpiriv = kotlin_kotlin.$_$.o1; 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.m(); while (_iterator__ex2g4s.n()) { var e = _iterator__ex2g4s.o(); var key = e.vw_1; if (set.e(key)) { list.e(e); } } // Inline function 'kotlin.collections.filter' call // Inline function 'kotlin.collections.filterTo' call var destination = ArrayList_init_$Create$(); var _iterator__ex2g4s_0 = list.m(); while (_iterator__ex2g4s_0.n()) { var element = _iterator__ex2g4s_0.o(); // 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.m(); while (_iterator__ex2g4s_1.n()) { var item = _iterator__ex2g4s_1.o(); var tmp$ret$2 = item.fw_1; destination_0.e(tmp$ret$2); } if (destination_0.d1(element.vw_1)) { destination.e(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.m(); while (_iterator__ex2g4s.n()) { var item = _iterator__ex2g4s.o(); var earlierTag = item.y9(); var nextTag = item.z9(); var tmp; if (earlierTag == null && !(nextTag == null)) { tmp = _this__u8e3s4.sw('^' + nextTag.vw_1, 'HEAD'); } else if (!(earlierTag == null) && !(nextTag == null)) { tmp = _this__u8e3s4.sw('^' + nextTag.vw_1, earlierTag.vw_1); } else if (!(earlierTag == null)) { tmp = _this__u8e3s4.tw(earlierTag.vw_1); } else { tmp = alwaysLeftParent(log); } var tmp$ret$0 = to(earlierTag, tmp); destination.e(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.m(); while (_iterator__ex2g4s_0.n()) { var element = _iterator__ex2g4s_0.o(); // Inline function 'kotlin.collections.isNotEmpty' call if (!element.x9_1.j()) { destination_0.e(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.m(); while (_iterator__ex2g4s.n()) { var item = _iterator__ex2g4s.o(); 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.e(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.m(); while (_iterator__ex2g4s.n()) { var element = _iterator__ex2g4s.o(); var acc = accumulator; var tmp; if (acc.j()) { tmp = plus_0(acc, element); } else if (element.fw_1 === firstOrNull(last(acc).jw_1)) { tmp = plus_0(acc, element); } else { tmp = acc; } accumulator = tmp; } return accumulator; } function CommitInspectionResult(storyId, ease, authors, semver) { this.xw_1 = storyId; this.yw_1 = ease; this.zw_1 = authors; this.ax_1 = semver; } protoOf(CommitInspectionResult).toString = function () { return 'CommitInspectionResult(storyId=' + this.xw_1 + ', ease=' + this.yw_1 + ', authors=' + toString(this.zw_1) + ', semver=' + toString_0(this.ax_1) + ')'; }; protoOf(CommitInspectionResult).hashCode = function () { var result = this.xw_1 == null ? 0 : getStringHashCode(this.xw_1); result = imul(result, 31) + (this.yw_1 == null ? 0 : this.yw_1) | 0; result = imul(result, 31) + hashCode(this.zw_1) | 0; result = imul(result, 31) + (this.ax_1 == null ? 0 : this.ax_1.hashCode()) | 0; return result; }; protoOf(CommitInspectionResult).equals = function (other) { if (this === other) return true; if (!(other instanceof CommitInspectionResult)) return false; var tmp0_other_with_cast = other instanceof CommitInspectionResult ? other : THROW_CCE(); if (!(this.xw_1 == tmp0_other_with_cast.xw_1)) return false; if (!(this.yw_1 == tmp0_other_with_cast.yw_1)) return false; if (!equals(this.zw_1, tmp0_other_with_cast.zw_1)) return false; if (!equals(this.ax_1, tmp0_other_with_cast.ax_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.m(); while (_iterator__ex2g4s.n()) { var item = _iterator__ex2g4s.o(); var tmp$ret$0 = commitInspectionResult(item, _this__u8e3s4.hx(item.kw_1)); destination.e(tmp$ret$0); } var messageDigResults = destination; var lastCommit = firstOrNull(commitRefs); var firstCommit = lastOrNull(commitRefs); var tmp1_elvis_lhs = lastCommit == null ? null : lastCommit.fw_1; var tmp7_lastCommit = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs; var tmp3_elvis_lhs = firstCommit == null ? null : firstCommit.fw_1; var tmp8_firstCommit = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs; var tmp9_authors = allAuthors(messageDigResults); var tmp10_dateTime = lastCommit == null ? null : lastCommit.iw_1; var tmp11_firstCommitDateTime = firstCommit == null ? null : firstCommit.iw_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.m(); while (_iterator__ex2g4s_0.n()) { var element = _iterator__ex2g4s_0.o(); var tmp0_safe_receiver = element.yw_1; if (tmp0_safe_receiver == null) null; else { // Inline function 'kotlin.let' call destination_0.e(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.m(); while (_iterator__ex2g4s_1.n()) { var element_0 = _iterator__ex2g4s_1.o(); var tmp0_safe_receiver_0 = element_0.ax_1; if (tmp0_safe_receiver_0 == null) null; else { // Inline function 'kotlin.let' call destination_1.e(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.p(); 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.ix_1, digResult.jx_1, plus(listOf_0([_this__u8e3s4.hw_1, _this__u8e3s4.gw_1]), digResult.kx_1), digResult.lx_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.m(); while (_iterator__ex2g4s.n()) { var element = _iterator__ex2g4s.o(); var list = element.zw_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.m(); while (_iterator__ex2g4s_0.n()) { var item = _iterator__ex2g4s_0.o(); // Inline function 'kotlin.text.lowercase' call // Inline function 'kotlin.js.asDynamic' call var tmp$ret$5 = item.toLowerCase(); destination_0.e(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.m(); while (_iterator__ex2g4s.n()) { var element = _iterator__ex2g4s.o(); var tmp0_safe_receiver = element.xw_1; if (tmp0_safe_receiver == null) null; else { // Inline function 'kotlin.let' call destination.e(tmp0_safe_receiver); } } // Inline function 'kotlin.let' call var tmp; // Inline function 'kotlin.collections.isNotEmpty' call if (!destination.j()) { tmp = joinToString(sorted(toSet(destination)), ', '); } else { tmp = null; } return tmp; } function currentContributionCommits(_this__u8e3s4, previousTag) { var tmp; if (previousTag == null) { tmp = _this__u8e3s4.rw(); } else { tmp = _this__u8e3s4.sw('^' + previousTag.uw_1, 'HEAD'); } return tmp; } function tagRefs($this) { // Inline function 'kotlin.collections.filter' call var tmp0 = $this.nx_1.qw(); // Inline function 'kotlin.collections.filterTo' call var destination = ArrayList_init_$Create$(); var _iterator__ex2g4s = tmp0.m(); while (_iterator__ex2g4s.n()) { var element = _iterator__ex2g4s.o(); if ($this.px_1.hc(element.uw_1)) { destination.e(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.vw_1) === headCommitId) { tmp = to(latestTag, getOrNull(lastTwoTags, 1)); } else { tmp = to(null, latestTag); } return tmp; } function Defaults() { Defaults_instance = this; this.qx_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().qx_1 : tagRegex; this.mx_1 = label; this.nx_1 = gitWrapper; this.ox_1 = messageDigger; this.px_1 = tagRegex; } protoOf(DiggerCore).rx = function () { // Inline function 'kotlin.with' call var $this$with = this.nx_1; var _destruct__k2r9zo = currentRelevantTags(this, $this$with.pw(), take(tagRefs(this), 2)); var currentTag = _destruct__k2r9zo.y9(); var previousTag = _destruct__k2r9zo.z9(); var tmp = contribution(this.ox_1, currentContributionCommits($this$with, previousTag)); var tmp_0 = currentTag == null ? null : currentTag.uw_1; return tmp.ew(VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, this.mx_1, tmp_0, currentTag == null ? null : currentTag.ww_1); }; protoOf(DiggerCore).sx = function () { // Inline function 'kotlin.collections.map' call var this_0 = allContributionCommits(this.nx_1, tagRefs(this), this.nx_1.rw()); // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10)); var _iterator__ex2g4s = this_0.m(); while (_iterator__ex2g4s.n()) { var item = _iterator__ex2g4s.o(); var tmp$ret$0 = to(item.w9_1, contribution(this.ox_1, toList(item.x9_1))); destination.e(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.m(); while (_iterator__ex2g4s_0.n()) { var item_0 = _iterator__ex2g4s_0.o(); var tag = item_0.y9(); var contribution_0 = item_0.z9(); var tmp = tag == null ? null : tag.uw_1; var tmp$ret$3 = contribution_0.ew(VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, this.mx_1, tmp, tag == null ? null : tag.ww_1); destination_0.e(tmp$ret$3); } return destination_0; }; function MessageDigResult(storyId, ease, coauthors, semver) { this.ix_1 = storyId; this.jx_1 = ease; this.kx_1 = coauthors; this.lx_1 = semver; } protoOf(MessageDigResult).toString = function () { return 'MessageDigResult(storyId=' + this.ix_1 + ', ease=' + this.jx_1 + ', coauthors=' + toString(this.kx_1) + ', semver=' + toString_0(this.lx_1) + ')'; }; protoOf(MessageDigResult).hashCode = function () { var result = this.ix_1 == null ? 0 : getStringHashCode(this.ix_1); result = imul(result, 31) + (this.jx_1 == null ? 0 : this.jx_1) | 0; result = imul(result, 31) + hashCode(this.kx_1) | 0; result = imul(result, 31) + (this.lx_1 == null ? 0 : this.lx_1.hashCode()) | 0; return result; }; protoOf(MessageDigResult).equals = function (other) { if (this === other) return true; if (!(other instanceof MessageDigResult)) return false; var tmp0_other_with_cast = other instanceof MessageDigResult ? other : THROW_CCE(); if (!(this.ix_1 == tmp0_other_with_cast.ix_1)) return false; if (!(this.jx_1 == tmp0_other_with_cast.jx_1)) return false; if (!equals(this.kx_1, tmp0_other_with_cast.kx_1)) return false; if (!equals(this.lx_1, tmp0_other_with_cast.lx_1)) return false; return true; }; function Defaults_0() { Defaults_instance_0 = this; this.tx_1 = Regex_init_$Create$_0('\\[major\\]', RegexOption_IGNORE_CASE_getInstance()); this.ux_1 = Regex_init_$Create$_0('\\[minor\\]', RegexOption_IGNORE_CASE_getInstance()); this.vx_1 = Regex_init_$Create$_0('\\[patch\\]', RegexOption_IGNORE_CASE_getInstance()); this.wx_1 = Regex_init_$Create$_0('\\[none\\]', RegexOption_IGNORE_CASE_getInstance()); this.xx_1 = Regex_init_$Create$('\\[(?<storyId>.*?)\\]'); this.yx_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().tx_1 : majorRegex; minorRegex = minorRegex === VOID ? Defaults_getInstance_0().ux_1 : minorRegex; patchRegex = patchRegex === VOID ? Defaults_getInstance_0().vx_1 : patchRegex; noneRegex = noneRegex === VOID ? Defaults_getInstance_0().wx_1 : noneRegex; storyIdRegex = storyIdRegex === VOID ? Defaults_getInstance_0().xx_1 : storyIdRegex; easeRegex = easeRegex === VOID ? Defaults_getInstance_0().yx_1 : easeRegex; if (!contains(storyIdRegex.bc_1, '?<storyId>')) { throw RuntimeException_init_$Create$('StoryIdRegex must include a storyId group. The regex was: ' + storyIdRegex.bc_1); } if (!contains(easeRegex.bc_1, '?<ease>')) { throw RuntimeException_init_$Create$('EaseRegex must include an ease group. The regex was: ' + easeRegex.bc_1); } this.bx_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.bx_1; // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$_0(this_0.p()); // Inline function 'kotlin.collections.iterator' call var _iterator__ex2g4s = this_0.x().m(); while (_iterator__ex2g4s.n()) { var item = _iterator__ex2g4s.o(); // Inline function 'kotlin.collections.component1' call var group = item.y(); // Inline function 'kotlin.collections.component2' call var regex = item.z(); var tmp$ret$3 = '(?<' + group + '>' + cleaned(regex) + ')?'; destination.e(tmp$ret$3); } tmp.cx_1 = joinToString(destination, ''); this.dx_1 = '(' + cleaned(storyIdRegex) + ')?'; this.ex_1 = '(' + cleaned(easeRegex) + ')?'; this.fx_1 = '(Co-authored-by: .* <(?<coAuthors>.*)>)?'; this.gx_1 = new Regex(this.cx_1 + this.dx_1 + this.ex_1 + this.fx_1, setOf([RegexOption_IGNORE_CASE_getInstance(), RegexOption_MULTILINE_getInstance()])); } protoOf(MessageDigger).hx = function (input) { return messageDigResult(this.gx_1.kc(input)); }; function cleaned(_this__u8e3s4) { var first = firstOrNull_0(_this__u8e3s4.bc_1); var last = lastIndexOf(_this__u8e3s4.bc_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.bc_1, 1, last); } else { tmp = _this__u8e3s4.bc_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.m(); while (_iterator__ex2g4s.n()) { var element = _iterator__ex2g4s.o(); var result = get(element.sc(), '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.oc_1; var tmp$ret$3; $l$block_0: { // Inline function 'kotlin.sequences.firstNotNullOfOrNull' call var _iterator__ex2g4s_0 = _this__u8e3s4.m(); while (_iterator__ex2g4s_0.n()) { var element_0 = _iterator__ex2g4s_0.o(); var result_0 = get(element_0.sc(), '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.oc_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.sc(), 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.sc(), 'coAuthors'); return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.oc_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