You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/UI/polyfills.js

42 lines
1.4 KiB

window.console = window.console || {};
9 years ago
window.console.log = window.console.log || function(){
};
window.console.group = window.console.group || function(){
};
window.console.groupEnd = window.console.groupEnd || function(){
};
window.console.debug = window.console.debug || function(){
};
window.console.warn = window.console.warn || function(){
};
window.console.assert = window.console.assert || function(){
};
if(!String.prototype.startsWith) {
Object.defineProperty(String.prototype, 'startsWith', {
9 years ago
enumerable : false,
configurable : false,
writable : false,
value : function(searchString, position){
position = position || 0;
return this.indexOf(searchString, position) === position;
}
});
}
9 years ago
if(!String.prototype.endsWith) {
Object.defineProperty(String.prototype, 'endsWith', {
9 years ago
enumerable : false,
configurable : false,
writable : false,
value : function(searchString, position){
position = position || this.length;
position = position - searchString.length;
var lastIndex = this.lastIndexOf(searchString);
return lastIndex !== -1 && lastIndex === position;
}
});
}
9 years ago
if(!('contains' in String.prototype)) {
String.prototype.contains = function(str, startIndex){
return -1 !== String.prototype.indexOf.call(this, str, startIndex);
};
9 years ago
}