From 563251d6082628711d221122ce75973690641af8 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 8 Apr 2021 17:46:43 +0100 Subject: [PATCH] DEV: Remove String.endsWith polyfill (#106) Discourse no longer supports internet explorer. This function is supported natively on all browsers Discourse currently targets. --- .../initializers/initialize-data-explorer.js.es6 | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/assets/javascripts/discourse/initializers/initialize-data-explorer.js.es6 b/assets/javascripts/discourse/initializers/initialize-data-explorer.js.es6 index b8da6ae..866c794 100644 --- a/assets/javascripts/discourse/initializers/initialize-data-explorer.js.es6 +++ b/assets/javascripts/discourse/initializers/initialize-data-explorer.js.es6 @@ -2,18 +2,5 @@ export default { name: "initialize-data-explorer", initialize(container) { container.lookup("store:main").addPluralization("query", "queries"); - - if (!String.prototype.endsWith) { - // eslint-disable-next-line no-extend-native - String.prototype.endsWith = function (searchString, position) { - const subjectString = this.toString(); - if (position === undefined || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - const lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - } }, };