File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export class Scope implements ScopeInterface {
45
45
46
46
/** Contexts */
47
47
// eslint-disable-next-line @typescript-eslint/no-explicit-any
48
- protected _contexts : { [ key : string ] : any } = { } ;
48
+ protected _contexts : { [ key : string ] : Record < any , any > } = { } ;
49
49
50
50
/** Fingerprint */
51
51
protected _fingerprint ?: string [ ] ;
@@ -185,9 +185,14 @@ export class Scope implements ScopeInterface {
185
185
/**
186
186
* @inheritDoc
187
187
*/
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 } ;
188
+ public setContext ( key : string , context : { [ key : string ] : Record < any , any > } | null ) : this {
189
+ if ( context === null ) {
190
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
191
+ delete this . _contexts [ key ] ;
192
+ } else {
193
+ this . _contexts = { ...this . _contexts , [ key ] : context } ;
194
+ }
195
+
191
196
this . _notifyScopeListeners ( ) ;
192
197
return this ;
193
198
}
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