mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-10 17:42:50 +08:00
19 lines
351 B
TypeScript
19 lines
351 B
TypeScript
/**
|
|
* 浏览器兼容性处理
|
|
*/
|
|
|
|
/**
|
|
* 修复低版本Safari等浏览器数组不支持at函数的问题
|
|
*/
|
|
;(function fixArrayAt() {
|
|
if (!Array.prototype.at) {
|
|
Array.prototype.at = function (index: number) {
|
|
if (index >= 0) {
|
|
return this[index]
|
|
} else {
|
|
return this[this.length + index]
|
|
}
|
|
}
|
|
}
|
|
})()
|