import { API , FileInfo , Options } from 'jscodeshift' ; export type ExportInfo = { local : string ; exported : string ; source : string ; } ; export type ExportMap = { [ key ] : ExportInfo ; } ; export const getExportMapDeclaration = ( file , api , options ) => { const j = api . jscodeshift ; const root = j ( file . source ) ; const exportToSource = { } ; root . find ( j . ExportNamedDeclaration ) . filter ( ( path ) => { if ( ! path . node . source ) { return false ; } return true ; } ) . forEach ( ( path ) => { path . node . specifiers . map ( ( s ) => { exportToSource [ s . exported . name ] = { local : s . local ?. name , exported : s . exported . name , source : path . node . source . value } ; } ) ; } ) ; return exportToSource ; } ; export default getExportMapDeclaration ; export const parser = 'tsx' ;