Files
discourse-data-explorer/assets/javascripts/discourse/initializers/initialize-data-explorer.js.es6
T

20 lines
681 B
JavaScript
Raw Normal View History

2015-08-25 20:48:19 -07:00
export default {
2018-10-10 17:26:23 +05:30
name: "initialize-data-explorer",
2015-08-25 20:48:19 -07:00
initialize(container) {
2018-10-10 17:26:23 +05:30
container.lookup("store:main").addPluralization("query", "queries");
2015-11-21 12:49:23 +11:00
2015-08-25 20:48:19 -07:00
if (!String.prototype.endsWith) {
2019-06-14 12:29:06 -04:00
// eslint-disable-next-line no-extend-native
2020-09-04 13:23:11 +02:00
String.prototype.endsWith = function (searchString, position) {
const subjectString = this.toString();
2015-08-25 20:48:19 -07:00
if (position === undefined || position > subjectString.length) {
position = subjectString.length;
}
position -= searchString.length;
const lastIndex = subjectString.indexOf(searchString, position);
2015-08-25 20:48:19 -07:00
return lastIndex !== -1 && lastIndex === position;
};
}
2020-09-04 13:23:11 +02:00
},
2015-08-25 20:48:19 -07:00
};