karakum 1.0.0-alpha.90 → 1.0.0-alpha.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,7 +21,7 @@ Gradle plugin for Kotlin Gradle projects:
21
21
 
22
22
  ```kotlin
23
23
  plugins {
24
- id("io.github.sgrishchenko.karakum") version "1.0.0-alpha.90"
24
+ id("io.github.sgrishchenko.karakum") version "1.0.0-alpha.92"
25
25
  }
26
26
  ```
27
27
 
@@ -153,6 +153,7 @@ import {
153
153
  getOrNull1go7ef9ldk0df as getOrNull_0,
154
154
  first1vi3grnpj1175 as first_0,
155
155
  arrayConcat3qsij7vh68m69 as arrayConcat,
156
+ removePrefix279df90bhrqqg as removePrefix,
156
157
  toSet2orjxp16sotqu as toSet,
157
158
  firstOrNull1gk7vzkf4h3nq as firstOrNull,
158
159
  charCodeAt1yspne1d8erbm as charCodeAt,
@@ -2706,7 +2707,8 @@ function normalizeOption_0(patterns, defaultValue) {
2706
2707
  } else {
2707
2708
  // Inline function 'io.github.sgrishchenko.karakum.util.toArray' call
2708
2709
  var tmp_0;
2709
- if (isArray(patterns)) {
2710
+ var tmp_1 = !(patterns == null) ? patterns : THROW_CCE();
2711
+ if (!(tmp_1 == null) ? isArray(tmp_1) : false) {
2710
2712
  tmp_0 = patterns;
2711
2713
  } else {
2712
2714
  // Inline function 'kotlin.arrayOf' call
@@ -3078,7 +3080,8 @@ function normalizeOption_1(patterns, defaultValue) {
3078
3080
  } else {
3079
3081
  // Inline function 'io.github.sgrishchenko.karakum.util.toArray' call
3080
3082
  var tmp_1;
3081
- if (isArray(patterns)) {
3083
+ var tmp_2 = !(patterns == null) ? patterns : THROW_CCE();
3084
+ if (!(tmp_2 == null) ? isArray(tmp_2) : false) {
3082
3085
  tmp_1 = patterns;
3083
3086
  } else {
3084
3087
  // Inline function 'kotlin.arrayOf' call
@@ -3090,9 +3093,9 @@ function normalizeOption_1(patterns, defaultValue) {
3090
3093
  tmp_0 = isArray(result) ? result : THROW_CCE();
3091
3094
  }
3092
3095
  var tmp1_safe_receiver = tmp_0;
3093
- var tmp_2;
3096
+ var tmp_3;
3094
3097
  if (tmp1_safe_receiver == null) {
3095
- tmp_2 = null;
3098
+ tmp_3 = null;
3096
3099
  } else {
3097
3100
  // Inline function 'kotlin.collections.map' call
3098
3101
  // Inline function 'kotlin.collections.mapTo' call
@@ -3105,17 +3108,17 @@ function normalizeOption_1(patterns, defaultValue) {
3105
3108
  var tmp$ret$5 = typeof item === 'string' ? item : THROW_CCE();
3106
3109
  destination.k1(tmp$ret$5);
3107
3110
  }
3108
- tmp_2 = destination;
3111
+ tmp_3 = destination;
3109
3112
  }
3110
- var tmp2_safe_receiver = tmp_2;
3111
- var tmp_3;
3113
+ var tmp2_safe_receiver = tmp_3;
3114
+ var tmp_4;
3112
3115
  if (tmp2_safe_receiver == null) {
3113
- tmp_3 = null;
3116
+ tmp_4 = null;
3114
3117
  } else {
3115
3118
  // Inline function 'kotlin.collections.toTypedArray' call
3116
- tmp_3 = copyToArray(tmp2_safe_receiver);
3119
+ tmp_4 = copyToArray(tmp2_safe_receiver);
3117
3120
  }
3118
- var tmp3_elvis_lhs = tmp_3;
3121
+ var tmp3_elvis_lhs = tmp_4;
3119
3122
  return tmp3_elvis_lhs == null ? defaultValue : tmp3_elvis_lhs;
3120
3123
  }
3121
3124
  function createDefaultExtensionPatterns(name) {
@@ -12529,7 +12532,7 @@ function applyModuleNameMapper(moduleName, qualifier, configuration) {
12529
12532
  return {moduleName: mappedModuleName, qualifier: mappedQualifier};
12530
12533
  }
12531
12534
  function generateRelativeFileName(prefixes, sourceFileName) {
12532
- var tmp0 = removePrefix(sourceFileName, prefixes);
12535
+ var tmp0 = removePrefix_0(sourceFileName, prefixes);
12533
12536
  // Inline function 'kotlin.text.toRegex' call
12534
12537
  var this_0 = '\\.d\\.ts$';
12535
12538
  // Inline function 'kotlin.text.replace' call
@@ -12540,7 +12543,7 @@ function generateRelativeFileName(prefixes, sourceFileName) {
12540
12543
  }
12541
12544
  function extractModuleName(sourceFileName, configuration) {
12542
12545
  var inputRoots = configuration.inputRoots;
12543
- var libraryName = configuration.libraryName;
12546
+ var libraryName = prepareLibraryName(configuration.libraryName);
12544
12547
  var relativeFileName = generateRelativeFileName(inputRoots, sourceFileName);
12545
12548
  return default_1.posix.join(libraryName, relativeFileName);
12546
12549
  }
@@ -12848,7 +12851,7 @@ function packageToFileName(packageChunks, fileName) {
12848
12851
  }.call(this);
12849
12852
  }
12850
12853
  function packageToOutputFileName(packageChunks, fileName, configuration) {
12851
- var libraryName = configuration.libraryName;
12854
+ var libraryName = prepareLibraryName(configuration.libraryName);
12852
12855
  var libraryNameOutputPrefix = configuration.libraryNameOutputPrefix;
12853
12856
  var result = packageToFileName(packageChunks, fileName);
12854
12857
  if (libraryNameOutputPrefix) {
@@ -12862,7 +12865,18 @@ function packageToOutputFileName(packageChunks, fileName, configuration) {
12862
12865
  // Inline function 'kotlin.js.unsafeCast' call
12863
12866
  // Inline function 'kotlin.js.asDynamic' call
12864
12867
  var tmp$ret$2 = [basePackage];
12865
- return removePrefix(result, tmp$ret$2);
12868
+ return removePrefix_0(result, tmp$ret$2);
12869
+ }
12870
+ function prepareLibraryName(libraryName) {
12871
+ // Inline function 'kotlin.let' call
12872
+ var it = removePrefix(libraryName, '@types/');
12873
+ var tmp;
12874
+ if (contains_0(it, '__')) {
12875
+ tmp = '@' + replace(it, '__', '/');
12876
+ } else {
12877
+ tmp = it;
12878
+ }
12879
+ return tmp;
12866
12880
  }
12867
12881
  function get_classMatcher() {
12868
12882
  _init_properties_prepareStructure_kt__ffd0wk();
@@ -13212,7 +13226,7 @@ function _init_properties_prepareStructure_kt__ffd0wk() {
13212
13226
  topLevelMatcher = topLevelMatcher$lambda;
13213
13227
  }
13214
13228
  }
13215
- function removePrefix(sourceFileName, prefixes) {
13229
+ function removePrefix_0(sourceFileName, prefixes) {
13216
13230
  var inductionVariable = 0;
13217
13231
  var last = prefixes.length;
13218
13232
  while (inductionVariable < last) {
@@ -13661,7 +13675,7 @@ function collectSourceFileInfo(sourceFiles, importInfo, configuration) {
13661
13675
  return copyToArray(destination);
13662
13676
  }
13663
13677
  function extractDirName(prefixes, sourceFileName) {
13664
- var relativeFileName = removePrefix(sourceFileName, prefixes);
13678
+ var relativeFileName = removePrefix_0(sourceFileName, prefixes);
13665
13679
  var dirName = default_1.dirname(relativeFileName);
13666
13680
  if (dirName === '.') {
13667
13681
  return '';
@@ -13681,7 +13695,7 @@ function extractFileName(sourceFileName) {
13681
13695
  }
13682
13696
  function createSourceFileInfoItem(sourceFileName, imports, configuration) {
13683
13697
  var inputRoots = configuration.inputRoots;
13684
- var libraryName = configuration.libraryName;
13698
+ var libraryName = prepareLibraryName(configuration.libraryName);
13685
13699
  var dirName = extractDirName(inputRoots, sourceFileName);
13686
13700
  var fileName = extractFileName(sourceFileName);
13687
13701
  var tmp0 = moduleNameToPackage(libraryName);