@cruglobal/godtools-shared 1.1.0-PR688-SNAPSHOT.1563 → 1.1.0-PR689-SNAPSHOT.1567

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.
@@ -48,6 +48,12 @@ if (typeof Math.log2 === 'undefined') {
48
48
  return Math.log(x) * Math.LOG2E;
49
49
  };
50
50
  }
51
+ if (typeof String.prototype.startsWith === 'undefined') {
52
+ Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) {
53
+ position = position || 0;
54
+ return this.lastIndexOf(searchString, position) === position;
55
+ }});
56
+ }
51
57
  if (typeof String.prototype.endsWith === 'undefined') {
52
58
  Object.defineProperty(String.prototype, 'endsWith', {value: function (searchString, position) {
53
59
  var subjectString = this.toString();
@@ -59,12 +65,6 @@ if (typeof String.prototype.endsWith === 'undefined') {
59
65
  return lastIndex !== -1 && lastIndex === position;
60
66
  }});
61
67
  }
62
- if (typeof String.prototype.startsWith === 'undefined') {
63
- Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) {
64
- position = position || 0;
65
- return this.lastIndexOf(searchString, position) === position;
66
- }});
67
- }
68
68
  if (typeof Math.imul === 'undefined') {
69
69
  Math.imul = function imul(a, b) {
70
70
  return (a & 4.29490176E9) * (b & 65535) + (a & 65535) * (b | 0) | 0;
@@ -9004,29 +9004,6 @@ if (typeof Math.imul === 'undefined') {
9004
9004
  ignoreCase = ignoreCase === VOID ? false : ignoreCase;
9005
9005
  return indexOf_1(_this__u8e3s4, char, VOID, ignoreCase) >= 0;
9006
9006
  }
9007
- function contains_5(_this__u8e3s4, other, ignoreCase) {
9008
- ignoreCase = ignoreCase === VOID ? false : ignoreCase;
9009
- var tmp;
9010
- if (typeof other === 'string') {
9011
- tmp = indexOf_2(_this__u8e3s4, other, VOID, ignoreCase) >= 0;
9012
- } else {
9013
- tmp = indexOf_3(_this__u8e3s4, other, 0, charSequenceLength(_this__u8e3s4), ignoreCase) >= 0;
9014
- }
9015
- return tmp;
9016
- }
9017
- function substringBefore(_this__u8e3s4, delimiter, missingDelimiterValue) {
9018
- missingDelimiterValue = missingDelimiterValue === VOID ? _this__u8e3s4 : missingDelimiterValue;
9019
- var index = indexOf_2(_this__u8e3s4, delimiter);
9020
- var tmp;
9021
- if (index === -1) {
9022
- tmp = missingDelimiterValue;
9023
- } else {
9024
- // Inline function 'kotlin.text.substring' call
9025
- // Inline function 'kotlin.js.asDynamic' call
9026
- tmp = _this__u8e3s4.substring(0, index);
9027
- }
9028
- return tmp;
9029
- }
9030
9007
  function substring(_this__u8e3s4, range) {
9031
9008
  // Inline function 'kotlin.text.substring' call
9032
9009
  var startIndex = range.s8();
@@ -9162,6 +9139,19 @@ if (typeof Math.imul === 'undefined') {
9162
9139
  }
9163
9140
  return tmp;
9164
9141
  }
9142
+ function lineSequence(_this__u8e3s4) {
9143
+ return splitToSequence(_this__u8e3s4, ['\r\n', '\n', '\r']);
9144
+ }
9145
+ function requireNonNegativeLimit(limit) {
9146
+ // Inline function 'kotlin.contracts.contract' call
9147
+ var tmp;
9148
+ if (!(limit >= 0)) {
9149
+ // Inline function 'kotlin.text.requireNonNegativeLimit.<anonymous>' call
9150
+ var message = 'Limit must be non-negative, but was ' + limit;
9151
+ throw IllegalArgumentException_init_$Create$_0(toString_1(message));
9152
+ }
9153
+ return tmp;
9154
+ }
9165
9155
  function indexOf_2(_this__u8e3s4, string, startIndex, ignoreCase) {
9166
9156
  startIndex = startIndex === VOID ? 0 : startIndex;
9167
9157
  ignoreCase = ignoreCase === VOID ? false : ignoreCase;
@@ -9181,55 +9171,6 @@ if (typeof Math.imul === 'undefined') {
9181
9171
  }
9182
9172
  return tmp;
9183
9173
  }
9184
- function indexOf_3(_this__u8e3s4, other, startIndex, endIndex, ignoreCase, last) {
9185
- last = last === VOID ? false : last;
9186
- var indices = !last ? numberRangeToNumber(coerceAtLeast_1(startIndex, 0), coerceAtMost_0(endIndex, charSequenceLength(_this__u8e3s4))) : downTo(coerceAtMost_0(startIndex, get_lastIndex_2(_this__u8e3s4)), coerceAtLeast_1(endIndex, 0));
9187
- var tmp;
9188
- if (typeof _this__u8e3s4 === 'string') {
9189
- tmp = typeof other === 'string';
9190
- } else {
9191
- tmp = false;
9192
- }
9193
- if (tmp) {
9194
- var inductionVariable = indices.hg_1;
9195
- var last_0 = indices.ig_1;
9196
- var step = indices.jg_1;
9197
- if ((step > 0 ? inductionVariable <= last_0 : false) ? true : step < 0 ? last_0 <= inductionVariable : false)
9198
- do {
9199
- var index = inductionVariable;
9200
- inductionVariable = inductionVariable + step | 0;
9201
- if (regionMatches(other, 0, _this__u8e3s4, index, charSequenceLength(other), ignoreCase))
9202
- return index;
9203
- }
9204
- while (!(index === last_0));
9205
- } else {
9206
- var inductionVariable_0 = indices.hg_1;
9207
- var last_1 = indices.ig_1;
9208
- var step_0 = indices.jg_1;
9209
- if ((step_0 > 0 ? inductionVariable_0 <= last_1 : false) ? true : step_0 < 0 ? last_1 <= inductionVariable_0 : false)
9210
- do {
9211
- var index_0 = inductionVariable_0;
9212
- inductionVariable_0 = inductionVariable_0 + step_0 | 0;
9213
- if (regionMatchesImpl(other, 0, _this__u8e3s4, index_0, charSequenceLength(other), ignoreCase))
9214
- return index_0;
9215
- }
9216
- while (!(index_0 === last_1));
9217
- }
9218
- return -1;
9219
- }
9220
- function lineSequence(_this__u8e3s4) {
9221
- return splitToSequence(_this__u8e3s4, ['\r\n', '\n', '\r']);
9222
- }
9223
- function requireNonNegativeLimit(limit) {
9224
- // Inline function 'kotlin.contracts.contract' call
9225
- var tmp;
9226
- if (!(limit >= 0)) {
9227
- // Inline function 'kotlin.text.requireNonNegativeLimit.<anonymous>' call
9228
- var message = 'Limit must be non-negative, but was ' + limit;
9229
- throw IllegalArgumentException_init_$Create$_0(toString_1(message));
9230
- }
9231
- return tmp;
9232
- }
9233
9174
  function calcNext_0($this) {
9234
9175
  if ($this.zh_1 < 0) {
9235
9176
  $this.xh_1 = 0;
@@ -9418,6 +9359,42 @@ if (typeof Math.imul === 'undefined') {
9418
9359
  var tmp = rangesDelimitedBy_0(_this__u8e3s4, delimiters, VOID, ignoreCase, limit);
9419
9360
  return map(tmp, splitToSequence$lambda(_this__u8e3s4));
9420
9361
  }
9362
+ function indexOf_3(_this__u8e3s4, other, startIndex, endIndex, ignoreCase, last) {
9363
+ last = last === VOID ? false : last;
9364
+ var indices = !last ? numberRangeToNumber(coerceAtLeast_1(startIndex, 0), coerceAtMost_0(endIndex, charSequenceLength(_this__u8e3s4))) : downTo(coerceAtMost_0(startIndex, get_lastIndex_2(_this__u8e3s4)), coerceAtLeast_1(endIndex, 0));
9365
+ var tmp;
9366
+ if (typeof _this__u8e3s4 === 'string') {
9367
+ tmp = typeof other === 'string';
9368
+ } else {
9369
+ tmp = false;
9370
+ }
9371
+ if (tmp) {
9372
+ var inductionVariable = indices.hg_1;
9373
+ var last_0 = indices.ig_1;
9374
+ var step = indices.jg_1;
9375
+ if ((step > 0 ? inductionVariable <= last_0 : false) ? true : step < 0 ? last_0 <= inductionVariable : false)
9376
+ do {
9377
+ var index = inductionVariable;
9378
+ inductionVariable = inductionVariable + step | 0;
9379
+ if (regionMatches(other, 0, _this__u8e3s4, index, charSequenceLength(other), ignoreCase))
9380
+ return index;
9381
+ }
9382
+ while (!(index === last_0));
9383
+ } else {
9384
+ var inductionVariable_0 = indices.hg_1;
9385
+ var last_1 = indices.ig_1;
9386
+ var step_0 = indices.jg_1;
9387
+ if ((step_0 > 0 ? inductionVariable_0 <= last_1 : false) ? true : step_0 < 0 ? last_1 <= inductionVariable_0 : false)
9388
+ do {
9389
+ var index_0 = inductionVariable_0;
9390
+ inductionVariable_0 = inductionVariable_0 + step_0 | 0;
9391
+ if (regionMatchesImpl(other, 0, _this__u8e3s4, index_0, charSequenceLength(other), ignoreCase))
9392
+ return index_0;
9393
+ }
9394
+ while (!(index_0 === last_1));
9395
+ }
9396
+ return -1;
9397
+ }
9421
9398
  function lastIndexOf(_this__u8e3s4, string, startIndex, ignoreCase) {
9422
9399
  startIndex = startIndex === VOID ? get_lastIndex_2(_this__u8e3s4) : startIndex;
9423
9400
  ignoreCase = ignoreCase === VOID ? false : ignoreCase;
@@ -9469,6 +9446,29 @@ if (typeof Math.imul === 'undefined') {
9469
9446
  }
9470
9447
  return toString_1(tmp$ret$1);
9471
9448
  }
9449
+ function contains_5(_this__u8e3s4, other, ignoreCase) {
9450
+ ignoreCase = ignoreCase === VOID ? false : ignoreCase;
9451
+ var tmp;
9452
+ if (typeof other === 'string') {
9453
+ tmp = indexOf_2(_this__u8e3s4, other, VOID, ignoreCase) >= 0;
9454
+ } else {
9455
+ tmp = indexOf_3(_this__u8e3s4, other, 0, charSequenceLength(_this__u8e3s4), ignoreCase) >= 0;
9456
+ }
9457
+ return tmp;
9458
+ }
9459
+ function substringBefore(_this__u8e3s4, delimiter, missingDelimiterValue) {
9460
+ missingDelimiterValue = missingDelimiterValue === VOID ? _this__u8e3s4 : missingDelimiterValue;
9461
+ var index = indexOf_2(_this__u8e3s4, delimiter);
9462
+ var tmp;
9463
+ if (index === -1) {
9464
+ tmp = missingDelimiterValue;
9465
+ } else {
9466
+ // Inline function 'kotlin.text.substring' call
9467
+ // Inline function 'kotlin.js.asDynamic' call
9468
+ tmp = _this__u8e3s4.substring(0, index);
9469
+ }
9470
+ return tmp;
9471
+ }
9472
9472
  function splitToSequence_0(_this__u8e3s4, delimiters, ignoreCase, limit) {
9473
9473
  ignoreCase = ignoreCase === VOID ? false : ignoreCase;
9474
9474
  limit = limit === VOID ? 0 : limit;