@@ -123,25 +123,15 @@ const generateUnformattedCode = (
123
123
const elementTagDetails = ( childElement : object ) => {
124
124
let customizationDetails = '' ;
125
125
let passedInPropsString = '' ;
126
- console . log ( { childElement} )
127
126
if ( childElement . type === 'Component' ) {
128
127
let childComponent ;
129
128
for ( let i = 0 ; i < components . length ; i ++ ) {
130
129
if ( childElement . name === components [ i ] . name ) {
131
130
childComponent = components [ i ] ;
132
131
}
133
132
}
134
- console . log ( { childComponent} )
135
- console . log ( 'childComponent.passedinprops' , childComponent . passedInProps )
136
-
137
-
138
- console . log ( 'past initial length check' )
139
- console . log ( 'childComponent.passedInProps.length' , childComponent . passedInProps . length ) ;
140
- childComponent . passedInProps . forEach ( prop => { passedInPropsString += `${ prop . key } = {${ prop . key } } `
141
- console . log ( { prop} )
133
+ childComponent . passedInProps . forEach ( prop => { passedInPropsString += `${ prop . key } = {${ prop . key } } `
142
134
} )
143
-
144
- console . log ( { passedInPropsString} )
145
135
}
146
136
147
137
@@ -267,7 +257,6 @@ const generateUnformattedCode = (
267
257
return `${ enrichedChildren
268
258
. map ( ( child : any ) => {
269
259
if ( child . type === 'Component' ) {
270
- console . log ( { enrichedChildren} )
271
260
return `<${ child . name } ${ elementTagDetails ( child ) } />` ;
272
261
} else if ( child . type === 'HTML Element' ) {
273
262
return elementGenerator ( child , level ) ;
@@ -297,7 +286,6 @@ const generateUnformattedCode = (
297
286
for ( const element of stateArray ) {
298
287
stateToRender += levelSpacer ( 2 , 2 ) + element + ';' ;
299
288
}
300
- console . log ( { stateToRender} )
301
289
return stateToRender ;
302
290
} ;
303
291
const enrichedChildren : any = getEnrichedChildren ( currComponent ) ;
@@ -381,27 +369,23 @@ const generateUnformattedCode = (
381
369
382
370
//return a string with all contexts provider in component's body
383
371
const createRender = ( ) => {
384
- console . log ( 'createRender runs' )
385
372
let result = `${ writeNestedElements ( enrichedChildren ) } ` ;
386
- console . log ( { result} )
387
- console . log ( { enrichedChildren} )
388
373
if ( importReactRouter ) result = `<Router>\n ${ result } \n </Router>` ;
389
374
if ( allContext . length < 1 ) return result ;
390
375
391
376
if ( currComponent . name === 'App' ) {
392
377
allContext . reverse ( ) . forEach ( ( el , i ) => {
393
- let tabs = `\t\t` ;
394
- if ( i === allContext . length - 1 ) {
395
- tabs = `\t\t\t` ;
396
- }
397
- result = `${ tabs . repeat ( allContext . length - i ) } <${
398
- el . name
399
- } Provider>\n ${ result } \n ${ tabs . repeat ( allContext . length - i ) } </${
400
- el . name
401
- } Provider>`;
378
+ let tabs = `\t\t` ;
379
+ if ( i === allContext . length - 1 ) {
380
+ tabs = `\t\t\t` ;
381
+ }
382
+ result = `${ tabs . repeat ( allContext . length - i ) } <${
383
+ el . name
384
+ } Provider>\n ${ result } \n ${ tabs . repeat ( allContext . length - i ) } </${
385
+ el . name
386
+ } Provider>`;
402
387
} ) ;
403
388
}
404
- console . log ( 'result from createRender' , result ) ;
405
389
return result ;
406
390
} ;
407
391
0 commit comments