From a77a97d8fc2e4cc576457e23a73f9c64657846ce Mon Sep 17 00:00:00 2001 From: tony Date: Fri, 19 Jun 2020 21:42:47 +0300 Subject: [PATCH] startsWith polyfill for android 4.4 --- src/js/polyfills.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/js/polyfills.js b/src/js/polyfills.js index d6083efbd..c4efc917f 100644 --- a/src/js/polyfills.js +++ b/src/js/polyfills.js @@ -19,3 +19,12 @@ if (typeof Object.assign != 'function') { return to; }; } + +if (!String.prototype.startsWith) { + Object.defineProperty(String.prototype, 'startsWith', { + value: function(search, rawPos) { + var pos = rawPos > 0 ? rawPos|0 : 0; + return this.substring(pos, pos + search.length) === search; + } + }); +}