File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/nuxt/src/runtime/plugins Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,12 @@ import type { Driver, Storage } from 'unstorage';
17
17
// @ts -expect-error - This is a virtual module
18
18
import { userStorageMounts } from '#sentry/storage-config.mjs' ;
19
19
20
- type MaybeInstrumentedDriver = Driver & {
20
+ type MaybeInstrumented < T > = T & {
21
21
__sentry_instrumented__ ?: boolean ;
22
22
} ;
23
23
24
+ type MaybeInstrumentedDriver = MaybeInstrumented < Driver > ;
25
+
24
26
type DriverMethod = keyof Driver ;
25
27
26
28
/**
@@ -175,7 +177,10 @@ function createMethodWrapper(
175
177
* Wraps the storage mount method to instrument the driver.
176
178
*/
177
179
function wrapStorageMount ( storage : Storage ) : Storage [ 'mount' ] {
178
- const original = storage . mount ;
180
+ const original : MaybeInstrumented < Storage [ 'mount' ] > = storage . mount ;
181
+ if ( original . __sentry_instrumented__ ) {
182
+ return original ;
183
+ }
179
184
180
185
function mountWithInstrumentation ( base : string , driver : Driver ) : Storage {
181
186
debug . log ( `[storage] Instrumenting mount: "${ base } "` ) ;
@@ -185,6 +190,8 @@ function wrapStorageMount(storage: Storage): Storage['mount'] {
185
190
return original ( base , instrumentedDriver ) ;
186
191
}
187
192
193
+ mountWithInstrumentation . __sentry_instrumented__ = true ;
194
+
188
195
return mountWithInstrumentation ;
189
196
}
190
197
You can’t perform that action at this time.
0 commit comments