const originalSetTimeout = globalThis . setTimeout ; export function setTimeout ( cb , delay ? , ... args ) { const result = originalSetTimeout ( cb , delay , ... args ) ; return typeof result === "number" ? result : ( result as any ) [ Symbol . toPrimitive ] ( ) ; } const originalSetInterval = globalThis . setInterval ; export function setInterval ( cb , delay ? , ... args ) { const result = originalSetInterval ( cb , delay , ... args ) ; return typeof result === "number" ? result : ( result as any ) [ Symbol . toPrimitive ] ( ) ; }