import { API , FileInfo , Options } from 'jscodeshift' ; export function createQueryRendererModern ( file , api , options ) { const j = api . jscodeshift ; const root = j ( file . source ) ; const printOptions = options . printOptions || { quote : 'single' , trailingComma : false , lineTerminator : '\n' } ; root . find ( j . CallExpression ) . filter ( ( path ) => { if ( path . node . callee . type === 'Identifier' && path . node . callee . name === 'createQueryRendererModern' ) { if ( path . node . arguments . length === 3 ) { return true ; } return false ; } return false ; } ) . forEach ( ( path ) => { const newArgs = [ path . node . arguments [ 0 ] , path . node . arguments [ 2 ] ] ; j ( path ) . replaceWith ( j . callExpression ( j . identifier ( 'createQueryRendererModern' ) , newArgs ) ) ; return path . node ; } ) ; return root . toSource ( printOptions ) ; } export const parser = 'tsx' ; export default createQueryRendererModern ;