1- import { convertIntegrationFnToClass } from '@sentry/core' ;
1+ import { convertIntegrationFnToClass , defineIntegration } from '@sentry/core' ;
22import type { Event , Integration , IntegrationClass , IntegrationFn , StackFrame } from '@sentry/types' ;
33import { GLOBAL_OBJ , addContextToFrame , stripUrlQueryAndFragment } from '@sentry/utils' ;
44
@@ -18,7 +18,7 @@ interface ContextLinesOptions {
1818 frameContextLines ?: number ;
1919}
2020
21- const contextLinesIntegration = ( ( options : ContextLinesOptions = { } ) => {
21+ const _contextLinesIntegration = ( ( options : ContextLinesOptions = { } ) => {
2222 const contextLines = options . frameContextLines != null ? options . frameContextLines : DEFAULT_LINES_OF_CONTEXT ;
2323
2424 return {
@@ -31,6 +31,8 @@ const contextLinesIntegration = ((options: ContextLinesOptions = {}) => {
3131 } ;
3232} ) satisfies IntegrationFn ;
3333
34+ export const contextLinesIntegration = defineIntegration ( _contextLinesIntegration ) ;
35+
3436/**
3537 * Collects source context lines around the lines of stackframes pointing to JS embedded in
3638 * the current page's HTML.
@@ -41,6 +43,8 @@ const contextLinesIntegration = ((options: ContextLinesOptions = {}) => {
4143 *
4244 * Use this integration if you have inline JS code in HTML pages that can't be accessed
4345 * by our backend (e.g. due to a login-protected page).
46+ *
47+ * @deprecated Use `contextLinesIntegration()` instead.
4448 */
4549// eslint-disable-next-line deprecation/deprecation
4650export const ContextLines = convertIntegrationFnToClass ( INTEGRATION_NAME , contextLinesIntegration ) as IntegrationClass <
0 commit comments