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';
1717// @ts -expect-error - This is a virtual module
1818import { userStorageMounts } from '#sentry/storage-config.mjs' ;
1919
20- type MaybeInstrumentedDriver = Driver & {
20+ type MaybeInstrumented < T > = T & {
2121 __sentry_instrumented__ ?: boolean ;
2222} ;
2323
24+ type MaybeInstrumentedDriver = MaybeInstrumented < Driver > ;
25+
2426type DriverMethod = keyof Driver ;
2527
2628/**
@@ -175,7 +177,10 @@ function createMethodWrapper(
175177 * Wraps the storage mount method to instrument the driver.
176178 */
177179function 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+ }
179184
180185 function mountWithInstrumentation ( base : string , driver : Driver ) : Storage {
181186 debug . log ( `[storage] Instrumenting mount: "${ base } "` ) ;
@@ -185,6 +190,8 @@ function wrapStorageMount(storage: Storage): Storage['mount'] {
185190 return original ( base , instrumentedDriver ) ;
186191 }
187192
193+ mountWithInstrumentation . __sentry_instrumented__ = true ;
194+
188195 return mountWithInstrumentation ;
189196}
190197
You can’t perform that action at this time.
0 commit comments