@@ -14,28 +14,27 @@ export const parseSourceCode = (sourceName: string, sourceCode: string, yulSourc
1414
1515 return { ...mainFile , ...( yulSource ? utilityFile : { } ) }
1616 }
17- case isMultiFile ( sourceCode ) : {
18- const contractsInfo = JSON . parse ( sourceCode ) as TInputSources
19- contractsInfo [ 'utility.yul' ] = { content : yulSource }
17+ case isMultiFileExtended ( sourceCode ) : {
18+ const contractsInfo = JSON . parse ( sourceCode . slice ( 1 , - 1 ) ) as TSourceCodeObject
19+ contractsInfo [ 'sources' ] [ ' utility.yul'] = { content : yulSource }
2020
21- return Object . entries ( contractsInfo . sources ) . reduce < Record < string , TSourceFile > > ( ( accumulator , [ contractPath , contractContent ] ) => {
21+ return Object . entries ( contractsInfo . sources ) . reduce < Record < string , TSourceFile > > ( ( accumulator , [ contractPath , contractDetails ] ) => {
2222 accumulator [ contractPath ] = {
2323 path : contractPath ,
2424 name : contractPath . split ( '/' ) . pop ( ) . split ( '.' ) . shift ( ) ,
25- content : contractContent ,
25+ content : contractDetails . content ,
2626 }
2727 return accumulator
2828 } , { } )
2929 }
30- case isMultiFileExtended ( sourceCode ) : {
31- const contractsInfo = JSON . parse ( sourceCode . slice ( 1 , - 1 ) ) as TSourceCodeObject
32- contractsInfo [ 'sources' ] [ 'utility.yul' ] = { content : yulSource }
33-
34- return Object . entries ( contractsInfo . sources ) . reduce < Record < string , TSourceFile > > ( ( accumulator , [ contractPath , contractDetails ] ) => {
30+ case isMultiFile ( sourceCode ) : {
31+ const contractsInfo = JSON . parse ( sourceCode ) as TInputSources
32+ contractsInfo [ 'utility.yul' ] = { content : yulSource }
33+ return Object . entries ( contractsInfo ) . reduce < Record < string , TSourceFile > > ( ( accumulator , [ contractPath , contractContent ] ) => {
3534 accumulator [ contractPath ] = {
3635 path : contractPath ,
3736 name : contractPath . split ( '/' ) . pop ( ) . split ( '.' ) . shift ( ) ,
38- content : contractDetails . content ,
37+ content : contractContent . content ,
3938 }
4039 return accumulator
4140 } , { } )
0 commit comments