import { Core , JSCodeshift } from 'jscodeshift' ; const findComponents = ( componentName , root , j ) => { const IS_DOT_NOTATION = componentName . includes ( '.' ) ; if ( IS_DOT_NOTATION ) { const [ objectName , propertyName ] = componentName . split ( '.' ) ; return root . find ( j . JSXElement , { openingElement : { name : { object : { name : objectName } , property : { name : propertyName } } } } ) ; } return root . findJSXElements ( componentName ) ; } ; export { findComponents } ;