Skip to content

Commit 6a898d1

Browse files
committed
remove as any casts
1 parent 2b2f619 commit 6a898d1

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

src/common/utils/runtime-info.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
import { detectRuntime } from './env';
22

3+
// Extend globalThis to include runtime-specific globals
4+
declare global {
5+
// eslint-disable-next-line no-var
6+
var Deno:
7+
| {
8+
version: {
9+
deno: string;
10+
};
11+
}
12+
| undefined;
13+
14+
// eslint-disable-next-line no-var
15+
var Bun:
16+
| {
17+
version: string;
18+
}
19+
| undefined;
20+
}
21+
322
export interface RuntimeInfo {
423
name: string;
524
version?: string;
@@ -23,12 +42,11 @@ export function getRuntimeInfo(): RuntimeInfo {
2342

2443
case 'deno':
2544
// Deno.version.deno returns just version number (e.g., "1.36.4")
26-
version = (globalThis as any).Deno?.version?.deno;
45+
version = globalThis.Deno?.version?.deno;
2746
break;
2847

2948
case 'bun':
30-
version =
31-
(globalThis as any).Bun?.version || extractBunVersionFromUserAgent();
49+
version = globalThis.Bun?.version || extractBunVersionFromUserAgent();
3250
break;
3351

3452
// These environments typically don't expose version info

0 commit comments

Comments
 (0)