From 270dc404436bb06e7f688796345b70d3d3261270 Mon Sep 17 00:00:00 2001 From: Ralf Kistner Date: Thu, 5 Sep 2024 17:42:08 +0200 Subject: [PATCH] Improve compatibility with older TypeScript versions. --- packages/web/src/db/sync/userAgent.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/web/src/db/sync/userAgent.ts b/packages/web/src/db/sync/userAgent.ts index 0838d868..c2a1f373 100644 --- a/packages/web/src/db/sync/userAgent.ts +++ b/packages/web/src/db/sync/userAgent.ts @@ -18,7 +18,8 @@ export function getUserAgentInfo(nav?: NavigatorInfo): string[] { const browser = getBrowserInfo(nav); const os = getOsInfo(nav); - return [browser, os].filter((v) => v != null); + // The cast below is to cater for TypeScript < 5.5.0 + return [browser, os].filter((v) => v != null) as string[]; } function getBrowserInfo(nav: NavigatorInfo): string | null {