Detect if a field is used with cbHasField in repeater Fields

In ContentBlocks, I have an element that creates an accordion. This accordion is of the “Repeater” type.
In each element of the accordion, I add content, which can be formatting, text, other elements, or even nested elements.
How can I detect, across all levels, whether a specific element is present? At the top level, cbHasField works, but not for the other levels. Has anyone else worked on this issue before?

This would require inspecting the nested data for that field, which is not something we do in core at the moment.

Thanks, Mark, for this information. Since I’m handling this action at the time of saving (to store a relative path), I can take the time to traverse the element tree.
Is there a way to retrieve the tree via a query or an object’s value? Or can I use the JSON properties? What do you recommend for creating my own snippet that traverses the entire ContentBlocks structure created this way?