import { API , FileInfo , Options } from 'jscodeshift' ; import { relativeImportSourceRegex } from './relativeImportSourceRegex' ; export const getInternalImports = ( file , api , options ) => { const j = api . jscodeshift ; const root = j ( file . source ) ; let relativeImports = [ ] ; root . find ( j . ImportDeclaration ) . filter ( ( p ) => relativeImportSourceRegex . test ( p . node . source . value ) ) . forEach ( ( p ) => { relativeImports = [ ... relativeImports , p . node ] ; } ) ; return relativeImports ; } ; export default getInternalImports ; export const parser = 'tsx' ;