File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ export const viewHierarchyIntegration = defineIntegration((options: Options = {}
6262 continue ;
6363 }
6464
65- const componentName = getComponentName ( child ) || undefined ;
65+ const componentName = getComponentName ( child , 1 ) || undefined ;
6666 const tagName = child . tagName . toLowerCase ( ) ;
6767
6868 if ( skipHtmlTags . includes ( tagName ) ) {
Original file line number Diff line number Diff line change @@ -145,15 +145,14 @@ export function getLocationHref(): string {
145145 *
146146 * @returns a string representation of the component for the provided DOM element, or `null` if not found
147147 */
148- export function getComponentName ( elem : unknown ) : string | null {
148+ export function getComponentName ( elem : unknown , maxTraverseHeight : number = 5 ) : string | null {
149149 // @ts -expect-error WINDOW has HTMLElement
150150 if ( ! WINDOW . HTMLElement ) {
151151 return null ;
152152 }
153153
154154 let currentElem = elem as SimpleNode ;
155- const MAX_TRAVERSE_HEIGHT = 5 ;
156- for ( let i = 0 ; i < MAX_TRAVERSE_HEIGHT ; i ++ ) {
155+ for ( let i = 0 ; i < maxTraverseHeight ; i ++ ) {
157156 if ( ! currentElem ) {
158157 return null ;
159158 }
You can’t perform that action at this time.
0 commit comments