export const ExtractFieldsModifications = ( dataModel ) => { let hideField = false ; let privateField = false ; let currentCodeBlock ; const extractedData = [ ] ; dataModel . split ( '\n' ) . forEach ( ( line ) => { if ( line . includes ( '@skip' ) ) { return ( hideField = true ) ; } else if ( line . includes ( '@nullable' ) ) { return ( privateField = true ) ; } if ( line . includes ( 'model' ) ) { currentCodeBlock = { name : line . split ( ' ' ) [ 1 ] , type : 'model' } ; } else if ( line . includes ( 'enum' ) ) { currentCodeBlock = { name : line . split ( ' ' ) [ 1 ] , type : 'enum' } ; } const fieldName = line . split ( ' ' ) . filter ( ( e ) => e !== '' ) . map ( ( e ) => e . replace ( '\r' , '' ) ) [ 0 ] ; if ( hideField ) { extractedData . push ( { fieldName , hide : true , modelName : currentCodeBlock . name , } ) ; hideField = false ; } else if ( privateField ) { extractedData . push ( { fieldName , private : true , modelName : currentCodeBlock . name , } ) ; privateField = false ; } } ) ; return extractedData ; } ;