1
- import { Breadcrumb , CaptureContext , Event , Severity , SeverityLevel } from '@sentry/types' ;
1
+ import { Breadcrumb , CaptureContext , Event , Severity , SeverityLevel , Extras } from '@sentry/types' ;
2
2
3
3
import { getCurrentHub , Hub } from './hub' ;
4
4
import { Scope } from './scope' ;
@@ -63,7 +63,7 @@ export function captureEvent(event: Event): ReturnType<Hub['captureEvent']> {
63
63
* @param callback Callback function that receives Scope.
64
64
*/
65
65
export function configureScope ( callback : ( scope : Scope ) => void ) : ReturnType < Hub [ 'configureScope' ] > {
66
- return getCurrentHub ( ) . configureScope ( callback ) ;
66
+ getCurrentHub ( ) . configureScope ( callback ) ;
67
67
}
68
68
69
69
/**
@@ -75,7 +75,7 @@ export function configureScope(callback: (scope: Scope) => void): ReturnType<Hub
75
75
* @param breadcrumb The breadcrumb to record.
76
76
*/
77
77
export function addBreadcrumb ( breadcrumb : Breadcrumb ) : ReturnType < Hub [ 'addBreadcrumb' ] > {
78
- return getCurrentHub ( ) . addBreadcrumb ( breadcrumb ) ;
78
+ getCurrentHub ( ) . addBreadcrumb ( breadcrumb ) ;
79
79
}
80
80
81
81
/**
@@ -85,5 +85,13 @@ export function addBreadcrumb(breadcrumb: Breadcrumb): ReturnType<Hub['addBreadc
85
85
*/
86
86
// eslint-disable-next-line @typescript-eslint/no-explicit-any
87
87
export function setContext ( name : string , context : { [ key : string ] : any } | null ) : ReturnType < Hub [ 'setContext' ] > {
88
- return getCurrentHub ( ) . setContext ( name , context ) ;
88
+ getCurrentHub ( ) . setContext ( name , context ) ;
89
+ }
90
+
91
+ /**
92
+ * Set an object that will be merged sent as extra data with the event.
93
+ * @param extras Extras object to merge into current context.
94
+ */
95
+ export function setExtras ( extras : Extras ) : ReturnType < Hub [ 'setExtras' ] > {
96
+ getCurrentHub ( ) . setExtras ( extras ) ;
89
97
}
0 commit comments