mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-07 13:32:17 -07:00
Initial Commit Rework
This commit is contained in:
parent
74a4cc048c
commit
95051cbd63
2483 changed files with 101351 additions and 111396 deletions
39
frontend/src/polyfills.js
Normal file
39
frontend/src/polyfills.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
window.console = window.console || {};
|
||||
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', {
|
||||
enumerable: false,
|
||||
configurable: false,
|
||||
writable: false,
|
||||
value(searchString, position) {
|
||||
position = position || 0;
|
||||
return this.indexOf(searchString, position) === position;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!String.prototype.endsWith) {
|
||||
Object.defineProperty(String.prototype, 'endsWith', {
|
||||
enumerable: false,
|
||||
configurable: false,
|
||||
writable: false,
|
||||
value(searchString, position) {
|
||||
position = position || this.length;
|
||||
position = position - searchString.length;
|
||||
var lastIndex = this.lastIndexOf(searchString);
|
||||
return lastIndex !== -1 && lastIndex === position;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!('contains' in String.prototype)) {
|
||||
String.prototype.contains = function(str, startIndex) {
|
||||
return -1 !== String.prototype.indexOf.call(this, str, startIndex);
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue