Skip to content

Commit

Permalink
Improve compatibility with older TypeScript versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkistner committed Sep 5, 2024
1 parent 5105fa4 commit 270dc40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/web/src/db/sync/userAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 270dc40

Please sign in to comment.