@@ -25,7 +25,11 @@ function getDetectedPlatform(): DetectedPlatform {
2525 if ( typeof EdgeRuntime !== 'undefined' ) {
2626 return 'edge' ;
2727 }
28- if ( Object . prototype . toString . call ( typeof process !== 'undefined' ? process : 0 ) === '[object process]' ) {
28+ if (
29+ Object . prototype . toString . call (
30+ typeof ( globalThis as any ) . process !== 'undefined' ? ( globalThis as any ) . process : 0 ,
31+ ) === '[object process]'
32+ ) {
2933 return 'node' ;
3034 }
3135 return 'unknown' ;
@@ -73,18 +77,18 @@ const getPlatformProperties = (): PlatformProperties => {
7377 'X-Stainless-OS' : 'Unknown' ,
7478 'X-Stainless-Arch' : `other:${ EdgeRuntime } ` ,
7579 'X-Stainless-Runtime' : 'edge' ,
76- 'X-Stainless-Runtime-Version' : process . version ,
80+ 'X-Stainless-Runtime-Version' : ( globalThis as any ) . process . version ,
7781 } ;
7882 }
7983 // Check if Node.js
8084 if ( detectedPlatform === 'node' ) {
8185 return {
8286 'X-Stainless-Lang' : 'js' ,
8387 'X-Stainless-Package-Version' : VERSION ,
84- 'X-Stainless-OS' : normalizePlatform ( process . platform ) ,
85- 'X-Stainless-Arch' : normalizeArch ( process . arch ) ,
88+ 'X-Stainless-OS' : normalizePlatform ( ( globalThis as any ) . process . platform ) ,
89+ 'X-Stainless-Arch' : normalizeArch ( ( globalThis as any ) . process . arch ) ,
8690 'X-Stainless-Runtime' : 'node' ,
87- 'X-Stainless-Runtime-Version' : process . version ,
91+ 'X-Stainless-Runtime-Version' : ( globalThis as any ) . process . version ,
8892 } ;
8993 }
9094
0 commit comments