@@ -21,10 +21,12 @@ type MaybeInstrumentedDriver = Driver & {
2121 __sentry_instrumented__ ?: boolean ;
2222} ;
2323
24+ type DriverMethod = keyof Driver ;
25+
2426/**
2527 * Methods that should have a key argument.
2628 */
27- const KEYED_METHODS = new Set ( [
29+ const KEYED_METHODS = new Set < DriverMethod > ( [
2830 'hasItem' ,
2931 'getItem' ,
3032 'getItemRaw' ,
@@ -38,7 +40,7 @@ const KEYED_METHODS = new Set([
3840/**
3941 * Methods that should have a attribute to indicate a cache hit.
4042 */
41- const CACHE_HIT_METHODS = new Set ( [ 'hasItem' , 'getItem' , 'getKeys' ] ) ;
43+ const CACHE_HIT_METHODS = new Set < DriverMethod > ( [ 'hasItem' , 'getItem' , 'getItemRaw ', 'getKeys' ] ) ;
4244
4345/**
4446 * Creates a Nitro plugin that instruments the storage driver.
@@ -85,7 +87,7 @@ function instrumentDriver(driver: MaybeInstrumentedDriver, mountBase: string): D
8587
8688 // List of driver methods to instrument
8789 // get/set/remove are aliases and already use their {method}Item methods
88- const methodsToInstrument : ( keyof Driver ) [ ] = [
90+ const methodsToInstrument : DriverMethod [ ] = [
8991 'hasItem' ,
9092 'getItem' ,
9193 'getItemRaw' ,
@@ -120,7 +122,7 @@ function instrumentDriver(driver: MaybeInstrumentedDriver, mountBase: string): D
120122 */
121123function createMethodWrapper (
122124 original : ( ...args : unknown [ ] ) => unknown ,
123- methodName : string ,
125+ methodName : DriverMethod ,
124126 driver : Driver ,
125127 mountBase : string ,
126128) : ( ...args : unknown [ ] ) => unknown {
0 commit comments