File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,10 @@ export class Scope implements ScopeInterface {
40
40
protected _tags : { [ key : string ] : string } = { } ;
41
41
42
42
/** Extra */
43
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
- protected _extra : { [ key : string ] : any } = { } ;
43
+ protected _extra : { [ key : string ] : unknown } = { } ;
45
44
46
45
/** Contexts */
47
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
- protected _contexts : { [ key : string ] : any } = { } ;
46
+ protected _contexts : { [ key : string ] : Record < string , unknown > } = { } ;
49
47
50
48
/** Fingerprint */
51
49
protected _fingerprint ?: string [ ] ;
@@ -185,9 +183,14 @@ export class Scope implements ScopeInterface {
185
183
/**
186
184
* @inheritDoc
187
185
*/
188
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
189
- public setContext ( key : string , context : { [ key : string ] : any } | null ) : this {
190
- this . _contexts = { ...this . _contexts , [ key ] : context } ;
186
+ public setContext ( key : string , context : Record < string , unknown > | null ) : this {
187
+ if ( context === null ) {
188
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
189
+ delete this . _contexts [ key ] ;
190
+ } else {
191
+ this . _contexts = { ...this . _contexts , [ key ] : context } ;
192
+ }
193
+
191
194
this . _notifyScopeListeners ( ) ;
192
195
return this ;
193
196
}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export interface ScopeContext {
14
14
user : User ;
15
15
level : Severity ;
16
16
extra : { [ key : string ] : any } ;
17
- contexts : { [ key : string ] : any } ;
17
+ contexts : { [ key : string ] : Record < any , any > } ;
18
18
tags : { [ key : string ] : string } ;
19
19
fingerprint : string [ ] ;
20
20
}
You can’t perform that action at this time.
0 commit comments