@@ -120,8 +120,8 @@ export class ObjectUIError extends Error {
120120 this . name = 'ObjectUIError' ;
121121
122122 // Maintains proper stack trace for where error was thrown (only in V8)
123- if ( Error . captureStackTrace ) {
124- Error . captureStackTrace ( this , this . constructor ) ;
123+ if ( ( Error as any ) . captureStackTrace ) {
124+ ( Error as any ) . captureStackTrace ( this , this . constructor ) ;
125125 }
126126 }
127127
@@ -203,7 +203,7 @@ function interpolate(
203203 params : Record < string , string > ,
204204) : string {
205205 return template . replace ( / \$ \{ ( \w + ) \} / g, ( _match , key : string ) => {
206- if ( ! ( key in params ) && typeof process !== 'undefined' && process . env ?. NODE_ENV !== 'production' ) {
206+ if ( ! ( key in params ) && ( globalThis as any ) . process ? .env ?. NODE_ENV !== 'production' ) {
207207 console . warn ( `[ObjectUI] Missing interpolation parameter "${ key } " in error message template.` ) ;
208208 }
209209 return params [ key ] ?? `\${${ key } }` ;
@@ -254,8 +254,7 @@ export function createError(
254254 */
255255export function formatErrorMessage (
256256 error : ObjectUIError ,
257- isDev : boolean = typeof process !== 'undefined' &&
258- process . env ?. NODE_ENV !== 'production' ,
257+ isDev : boolean = ( globalThis as any ) . process ?. env ?. NODE_ENV !== 'production' ,
259258) : string {
260259 const entry = ERROR_CODES [ error . code ] ;
261260
0 commit comments