Skip to content

Commit

Permalink
DEV: Remove String.endsWith polyfill (#106)
Browse files Browse the repository at this point in the history
Discourse no longer supports internet explorer. This function is supported natively on all browsers Discourse currently targets.
  • Loading branch information
davidtaylorhq committed Apr 8, 2021
1 parent 82cb3ac commit 563251d
Showing 1 changed file with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
},
};

0 comments on commit 563251d

Please sign in to comment.