File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -129,12 +129,13 @@ function getDefaultSampleContext(): SampleContext {
129
129
// we must be in browser-js (or some derivative thereof)
130
130
else {
131
131
// we use `getGlobalObject()` rather than `window` since service workers also have a `location` property on `self`
132
- const globalObject = getGlobalObject ( ) ;
132
+ const globalObject = getGlobalObject < WindowOrWorkerGlobalScope > ( ) ;
133
133
134
134
if ( 'location' in globalObject ) {
135
135
// we take a copy of the location object rather than just a reference to it in case there's a navigation or
136
136
// redirect in the instant between when the transaction starts and when the sampler is called
137
- defaultSampleContext . location = { ...globalObject . location } ;
137
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
138
+ defaultSampleContext . location = { ...( globalObject as any ) . location } ;
138
139
}
139
140
}
140
141
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ describe('Hub', () => {
140
140
search : '?chase=me&please=thankyou' ,
141
141
} ;
142
142
143
- getGlobalObject ( ) . location = dogParkLocation as any ;
143
+ getGlobalObject < Window > ( ) . location = dogParkLocation as any ;
144
144
145
145
const tracesSampler = jest . fn ( ) ;
146
146
const hub = new Hub ( new BrowserClient ( { tracesSampler } ) ) ;
You can’t perform that action at this time.
0 commit comments