Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/cardbuilder/cardBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ const enableFocusTransform = !browser.slow && !browser.edge;
* @returns {string} The HTML markup for the cards.
*/
export function getCardsHtml(items, options) {
if (arguments.length === 1) {
options = arguments[0];
if (options === undefined) {
options = items;
items = options.items;
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/router/appRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ class AppRouter {
console.error('[AppRouter] Failed to fetch item', err);
});
} else {
if (arguments.length === 2) {
options = arguments[1];
if (options === undefined) {
options = serverId;
}

const url = this.getRouteUrl(item, options);
Expand Down
4 changes: 2 additions & 2 deletions src/components/scrollManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ class DocumentScroller {
* Scrolls window.
* @param {...mixed} args See window.scrollTo.
*/
scrollTo() {
window.scrollTo.apply(window, arguments);
scrollTo(...args) {
window.scrollTo.apply(window, args);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/lib/globalize/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ function translateKeyFromModule(key, module) {
return key;
}

export function translate(key) {
export function translate(key, ...args) {
let val = translateKey(key);
for (let i = 1; i < arguments.length; i++) {
val = val.replaceAll('{' + (i - 1) + '}', arguments[i].toLocaleString(currentCulture));
for (let i = 0; i < args.length; i++) {
val = val.replaceAll('{' + i + '}', args[i].toLocaleString(currentCulture));
}
return val;
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/jellyfin-apiclient/ServerConnections.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const getMaxBandwidth = () => {
class ServerConnections extends ConnectionManager {
firstConnection = false;

constructor() {
super(...arguments);
constructor(...args) {
super(...args);
this.localApiClient = null;
this.firstConnection = null;

Expand Down
5 changes: 3 additions & 2 deletions src/lib/legacy/domParserTextHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
}
} catch { /* noop */ }

DOMParserPrototype.parseFromString = function (markup, type) {
DOMParserPrototype.parseFromString = function (...args) {
const [markup, type] = args;
if (/^\s*text\/html\s*(?:;|$)/i.test(type)) {
const doc = document.implementation.createHTMLDocument('');
doc.documentElement.innerHTML = markup;
return doc;
} else {
return realParseFromString.apply(this, arguments);
return realParseFromString.apply(this, args);
}
};
}(DOMParser));
8 changes: 4 additions & 4 deletions src/lib/legacy/elementAppendPrepend.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
configurable: true,
enumerable: true,
writable: true,
value: function append() {
const argArr = Array.prototype.slice.call(arguments);
value: function append(...args) {
const argArr = Array.prototype.slice.call(args);
const docFrag = document.createDocumentFragment();

argArr.forEach(function (argItem) {
Expand All @@ -59,8 +59,8 @@
configurable: true,
enumerable: true,
writable: true,
value: function prepend() {
const argArr = Array.prototype.slice.call(arguments);
value: function prepend(...args) {
const argArr = Array.prototype.slice.call(args);
const docFrag = document.createDocumentFragment();

argArr.forEach(function (argItem) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/legacy/htmlMediaElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
const HTMLMediaElementPrototype = HTMLMediaElement.prototype;
const realPlay = HTMLMediaElementPrototype.play;

HTMLMediaElementPrototype.play = function () {
HTMLMediaElementPrototype.play = function (...args) {
// eslint-disable-next-line sonarjs/no-try-promise
try {
const promise = realPlay.apply(this, arguments);
const promise = realPlay.apply(this, args);

if (typeof promise?.then === 'function') {
return promise;
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/syncPlay/core/Helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export function waitForEventOnce(emitter, eventType, timeout, rejectEventTypes)
}
};

const callback = () => {
const callback = (...args) => {
clearAll();
resolve(arguments);
resolve(args);
};

const rejectCallback = (event) => {
Expand Down