diff --git a/web/src/common/errors.ts b/web/src/common/errors.ts index ad6156bfad..6d71b27704 100644 --- a/web/src/common/errors.ts +++ b/web/src/common/errors.ts @@ -16,7 +16,7 @@ export async function parseAPIError(error: Error): Promise { if (!(error instanceof ResponseError)) { return error; } - if (error.response.status < 400 && error.response.status > 499) { + if (error.response.status < 400 || error.response.status > 499) { return error; } const body = await error.response.json(); diff --git a/web/src/common/helpers/plex.ts b/web/src/common/helpers/plex.ts index 6e9639934b..c3735af5bd 100644 --- a/web/src/common/helpers/plex.ts +++ b/web/src/common/helpers/plex.ts @@ -55,9 +55,7 @@ export class PlexAPIClient { ): Promise<{ authUrl: string; pin: PlexPinResponse }> { const headers = { ...DEFAULT_HEADERS, - ...{ - "X-Plex-Client-Identifier": clientIdentifier, - }, + "X-Plex-Client-Identifier": clientIdentifier, }; const pinResponse = await fetch("https://plex.tv/api/v2/pins.json?strong=true", { method: "POST", @@ -75,9 +73,7 @@ export class PlexAPIClient { static async pinStatus(clientIdentifier: string, id: number): Promise { const headers = { ...DEFAULT_HEADERS, - ...{ - "X-Plex-Client-Identifier": clientIdentifier, - }, + "X-Plex-Client-Identifier": clientIdentifier, }; const pinResponse = await fetch(`https://plex.tv/api/v2/pins/${id}`, { headers: headers, diff --git a/web/src/common/utils.ts b/web/src/common/utils.ts index cbaef55f8c..ff4fe512b3 100644 --- a/web/src/common/utils.ts +++ b/web/src/common/utils.ts @@ -123,7 +123,7 @@ const isCSSResult = (v: unknown): v is CSSResult => // prettier-ignore export const _adaptCSS = (sheet: AdaptableStylesheet): CSSStyleSheet => - (typeof sheet === "string" ? css([sheet] as unknown as TemplateStringsArray, ...[]).styleSheet + (typeof sheet === "string" ? css([sheet] as unknown as TemplateStringsArray, []).styleSheet : isCSSResult(sheet) ? sheet.styleSheet : sheet) as CSSStyleSheet; diff --git a/web/src/elements/buttons/TokenCopyButton/ak-token-copy-button.stories.ts b/web/src/elements/buttons/TokenCopyButton/ak-token-copy-button.stories.ts index 6b3f52e84a..db6ddd63b5 100644 --- a/web/src/elements/buttons/TokenCopyButton/ak-token-copy-button.stories.ts +++ b/web/src/elements/buttons/TokenCopyButton/ak-token-copy-button.stories.ts @@ -12,7 +12,7 @@ import AKTokenCopyButton from "./ak-token-copy-button"; function makeid(length: number) { const sample = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - return new Array(length) + return Array.from({ length }) .fill(" ") .map(() => sample.charAt(Math.floor(Math.random() * sample.length))) .join(""); diff --git a/web/src/elements/router/RouterOutlet.ts b/web/src/elements/router/RouterOutlet.ts index 8aa54e0137..9d5687085c 100644 --- a/web/src/elements/router/RouterOutlet.ts +++ b/web/src/elements/router/RouterOutlet.ts @@ -91,7 +91,7 @@ export class RouterOutlet extends AKElement { let matchedRoute: RouteMatch | null = null; this.routes.some((route) => { const match = route.url.exec(activeUrl); - if (match != null) { + if (match !== null) { matchedRoute = new RouteMatch(route); matchedRoute.arguments = match.groups || {}; matchedRoute.fullUrl = activeUrl;