File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change 11import { 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+
322export 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
You can’t perform that action at this time.
0 commit comments