@guardian/feast-multiplatform-library 10.0.1 → 10.1.0
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.clz32 === 'undefined') {
|
|
|
48
48
|
};
|
|
49
49
|
}(Math.log, Math.LN2);
|
|
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
|
//endregion
|
|
69
69
|
(function (_) {
|
|
70
70
|
'use strict';
|
|
@@ -5886,6 +5886,15 @@ if (typeof String.prototype.startsWith === 'undefined') {
|
|
|
5886
5886
|
STRING_CASE_INSENSITIVE_ORDER = new sam$kotlin_Comparator$0(tmp);
|
|
5887
5887
|
}
|
|
5888
5888
|
}
|
|
5889
|
+
function endsWith(_this__u8e3s4, suffix, ignoreCase) {
|
|
5890
|
+
ignoreCase = ignoreCase === VOID ? false : ignoreCase;
|
|
5891
|
+
if (!ignoreCase) {
|
|
5892
|
+
// Inline function 'kotlin.text.nativeEndsWith' call
|
|
5893
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
5894
|
+
return _this__u8e3s4.endsWith(suffix);
|
|
5895
|
+
} else
|
|
5896
|
+
return regionMatches(_this__u8e3s4, _this__u8e3s4.length - suffix.length | 0, suffix, 0, suffix.length, ignoreCase);
|
|
5897
|
+
}
|
|
5889
5898
|
function replace(_this__u8e3s4, oldValue, newValue, ignoreCase) {
|
|
5890
5899
|
ignoreCase = ignoreCase === VOID ? false : ignoreCase;
|
|
5891
5900
|
var tmp2 = new RegExp(Companion_getInstance_5().ma(oldValue), ignoreCase ? 'gui' : 'gu');
|
|
@@ -5932,15 +5941,6 @@ if (typeof String.prototype.startsWith === 'undefined') {
|
|
|
5932
5941
|
while (inductionVariable < last);
|
|
5933
5942
|
return true;
|
|
5934
5943
|
}
|
|
5935
|
-
function endsWith(_this__u8e3s4, suffix, ignoreCase) {
|
|
5936
|
-
ignoreCase = ignoreCase === VOID ? false : ignoreCase;
|
|
5937
|
-
if (!ignoreCase) {
|
|
5938
|
-
// Inline function 'kotlin.text.nativeEndsWith' call
|
|
5939
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
5940
|
-
return _this__u8e3s4.endsWith(suffix);
|
|
5941
|
-
} else
|
|
5942
|
-
return regionMatches(_this__u8e3s4, _this__u8e3s4.length - suffix.length | 0, suffix, 0, suffix.length, ignoreCase);
|
|
5943
|
-
}
|
|
5944
5944
|
var REPLACEMENT_BYTE_SEQUENCE;
|
|
5945
5945
|
function decodeUtf8(bytes, startIndex, endIndex, throwOnMalformed) {
|
|
5946
5946
|
_init_properties_utf8Encoding_kt__9thjs4();
|
|
@@ -8130,6 +8130,12 @@ if (typeof String.prototype.startsWith === 'undefined') {
|
|
|
8130
8130
|
while (inductionVariable < length);
|
|
8131
8131
|
return isNegative ? result : negate(result);
|
|
8132
8132
|
}
|
|
8133
|
+
function removeSuffix(_this__u8e3s4, suffix) {
|
|
8134
|
+
if (endsWith_0(_this__u8e3s4, suffix)) {
|
|
8135
|
+
return substring(_this__u8e3s4, 0, _this__u8e3s4.length - charSequenceLength(suffix) | 0);
|
|
8136
|
+
}
|
|
8137
|
+
return _this__u8e3s4;
|
|
8138
|
+
}
|
|
8133
8139
|
function indexOfAny(_this__u8e3s4, chars, startIndex, ignoreCase) {
|
|
8134
8140
|
startIndex = startIndex === VOID ? 0 : startIndex;
|
|
8135
8141
|
ignoreCase = ignoreCase === VOID ? false : ignoreCase;
|
|
@@ -8199,6 +8205,26 @@ if (typeof String.prototype.startsWith === 'undefined') {
|
|
|
8199
8205
|
}
|
|
8200
8206
|
return tmp$ret$1;
|
|
8201
8207
|
}
|
|
8208
|
+
function endsWith_0(_this__u8e3s4, suffix, ignoreCase) {
|
|
8209
|
+
ignoreCase = ignoreCase === VOID ? false : ignoreCase;
|
|
8210
|
+
var tmp;
|
|
8211
|
+
var tmp_0;
|
|
8212
|
+
if (!ignoreCase) {
|
|
8213
|
+
tmp_0 = typeof _this__u8e3s4 === 'string';
|
|
8214
|
+
} else {
|
|
8215
|
+
tmp_0 = false;
|
|
8216
|
+
}
|
|
8217
|
+
if (tmp_0) {
|
|
8218
|
+
tmp = typeof suffix === 'string';
|
|
8219
|
+
} else {
|
|
8220
|
+
tmp = false;
|
|
8221
|
+
}
|
|
8222
|
+
if (tmp)
|
|
8223
|
+
return endsWith(_this__u8e3s4, suffix);
|
|
8224
|
+
else {
|
|
8225
|
+
return regionMatchesImpl(_this__u8e3s4, charSequenceLength(_this__u8e3s4) - charSequenceLength(suffix) | 0, suffix, 0, charSequenceLength(suffix), ignoreCase);
|
|
8226
|
+
}
|
|
8227
|
+
}
|
|
8202
8228
|
function trim(_this__u8e3s4) {
|
|
8203
8229
|
// Inline function 'kotlin.text.trim' call
|
|
8204
8230
|
var startIndex = 0;
|
|
@@ -8289,12 +8315,6 @@ if (typeof String.prototype.startsWith === 'undefined') {
|
|
|
8289
8315
|
return null;
|
|
8290
8316
|
}
|
|
8291
8317
|
}
|
|
8292
|
-
function removeSuffix(_this__u8e3s4, suffix) {
|
|
8293
|
-
if (endsWith_0(_this__u8e3s4, suffix)) {
|
|
8294
|
-
return substring(_this__u8e3s4, 0, _this__u8e3s4.length - charSequenceLength(suffix) | 0);
|
|
8295
|
-
}
|
|
8296
|
-
return _this__u8e3s4;
|
|
8297
|
-
}
|
|
8298
8318
|
function substringBefore(_this__u8e3s4, delimiter, missingDelimiterValue) {
|
|
8299
8319
|
missingDelimiterValue = missingDelimiterValue === VOID ? _this__u8e3s4 : missingDelimiterValue;
|
|
8300
8320
|
var index = indexOf_5(_this__u8e3s4, delimiter);
|
|
@@ -8353,26 +8373,6 @@ if (typeof String.prototype.startsWith === 'undefined') {
|
|
|
8353
8373
|
}
|
|
8354
8374
|
return tmp;
|
|
8355
8375
|
}
|
|
8356
|
-
function endsWith_0(_this__u8e3s4, suffix, ignoreCase) {
|
|
8357
|
-
ignoreCase = ignoreCase === VOID ? false : ignoreCase;
|
|
8358
|
-
var tmp;
|
|
8359
|
-
var tmp_0;
|
|
8360
|
-
if (!ignoreCase) {
|
|
8361
|
-
tmp_0 = typeof _this__u8e3s4 === 'string';
|
|
8362
|
-
} else {
|
|
8363
|
-
tmp_0 = false;
|
|
8364
|
-
}
|
|
8365
|
-
if (tmp_0) {
|
|
8366
|
-
tmp = typeof suffix === 'string';
|
|
8367
|
-
} else {
|
|
8368
|
-
tmp = false;
|
|
8369
|
-
}
|
|
8370
|
-
if (tmp)
|
|
8371
|
-
return endsWith(_this__u8e3s4, suffix);
|
|
8372
|
-
else {
|
|
8373
|
-
return regionMatchesImpl(_this__u8e3s4, charSequenceLength(_this__u8e3s4) - charSequenceLength(suffix) | 0, suffix, 0, charSequenceLength(suffix), ignoreCase);
|
|
8374
|
-
}
|
|
8375
|
-
}
|
|
8376
8376
|
function indexOf_7(_this__u8e3s4, other, startIndex, endIndex, ignoreCase, last) {
|
|
8377
8377
|
last = last === VOID ? false : last;
|
|
8378
8378
|
var indices = !last ? numberRangeToNumber(coerceAtLeast(startIndex, 0), coerceAtMost(endIndex, charSequenceLength(_this__u8e3s4))) : downTo(coerceAtMost(startIndex, get_lastIndex_3(_this__u8e3s4)), coerceAtLeast(endIndex, 0));
|