From 8a7cf7d8f8b5e43424cca5cdc1152f1439f58a66 Mon Sep 17 00:00:00 2001 From: Stamen Stoychev Date: Tue, 27 May 2025 10:14:45 +0300 Subject: [PATCH 1/2] fix(util): making some polyfills polyfills --- src/js/modules/infragistics.util.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/js/modules/infragistics.util.js b/src/js/modules/infragistics.util.js index dc51a08e1..72799eb22 100644 --- a/src/js/modules/infragistics.util.js +++ b/src/js/modules/infragistics.util.js @@ -3769,8 +3769,10 @@ return ret; }); - String.prototype.startsWith = function (s) { - return this.indexOf(s) === 0; + if (!String.prototype.startsWith) { + String.prototype.startsWith = function (s) { + return this.indexOf(s) === 0; + } }; String.prototype.startsWith1 = function (s, comparisonType) { @@ -3781,12 +3783,14 @@ return $.ig.util.stringCompare1(this.slice(0, s.length), s, comparisonType || 0) === 0; }; - String.prototype.endsWith = function (s, comparisonType) { - if (this.length < s.length) { - return false; - } + if (!String.prototype.endsWith) { + String.prototype.endsWith = function (s, comparisonType) { + if (this.length < s.length) { + return false; + } - return $.ig.util.stringCompare1(this.slice(-s.length), s, comparisonType || 0) === 0; + return $.ig.util.stringCompare1(this.slice(-s.length), s, comparisonType || 0) === 0; + } }; String.prototype.remove = function (index, count) { From 08da31cc1a9f3d5598a94faaa98311fa2b115314 Mon Sep 17 00:00:00 2001 From: Stamen Stoychev Date: Tue, 27 May 2025 10:25:44 +0300 Subject: [PATCH 2/2] chore(*): fixing jshint errors --- src/js/modules/infragistics.util.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/modules/infragistics.util.js b/src/js/modules/infragistics.util.js index 72799eb22..c71472479 100644 --- a/src/js/modules/infragistics.util.js +++ b/src/js/modules/infragistics.util.js @@ -3772,8 +3772,8 @@ if (!String.prototype.startsWith) { String.prototype.startsWith = function (s) { return this.indexOf(s) === 0; - } - }; + }; + } String.prototype.startsWith1 = function (s, comparisonType) { if (this.length < s.length) { @@ -3790,8 +3790,8 @@ } return $.ig.util.stringCompare1(this.slice(-s.length), s, comparisonType || 0) === 0; - } - }; + }; + } String.prototype.remove = function (index, count) { if (!count || ((index + count) > this.length)) {