Skip to content

Commit 4a71385

Browse files
committed
chore: fix lint errors
1 parent bfc30f6 commit 4a71385

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

packages/core/src/shared/userAgent.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const UA_LANG = 'lang/js';
1010
declare const window: { navigator?: { userAgent?: string } } | undefined;
1111

1212
function isBrowser(): boolean {
13-
return typeof window !== 'undefined';
13+
return window !== undefined;
1414
}
1515

1616
function uaProduct(): string {
@@ -19,20 +19,12 @@ function uaProduct(): string {
1919

2020
function uaOS(os: string | undefined, version: string | undefined) {
2121
const osSegment = `os/${os ?? 'unknown'}`;
22-
if (version) {
23-
return `${osSegment}#${version}`;
24-
} else {
25-
return osSegment;
26-
}
22+
return version ? `${osSegment}#${version}` : osSegment;
2723
}
2824

2925
function uaNode(version: string | undefined) {
3026
const nodeSegment = 'md/nodejs';
31-
if (version) {
32-
return `${nodeSegment}#${version}`;
33-
} else {
34-
return nodeSegment;
35-
}
27+
return version ? `${nodeSegment}#${version}` : nodeSegment;
3628
}
3729

3830
function browserUserAgent(): string {

0 commit comments

Comments
 (0)