diff options
-rw-r--r-- | packages/sol-doc/src/solidity_doc_generator.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/sol-doc/src/solidity_doc_generator.ts b/packages/sol-doc/src/solidity_doc_generator.ts index 1e9c7d5d7..09e78aef2 100644 --- a/packages/sol-doc/src/solidity_doc_generator.ts +++ b/packages/sol-doc/src/solidity_doc_generator.ts @@ -127,15 +127,14 @@ function _makeCompilerOptions(contractsDir: string, contractsToCompile?: string[ function _extractStructs(compiledContract: StandardContractOutput): CustomType[] { let customTypes: CustomType[] = []; for (const abiDefinition of compiledContract.abi) { + let types: CustomType[] = []; switch (abiDefinition.type) { case 'constructor': { - const types = _getStructsAsCustomTypes(abiDefinition); - customTypes = [...customTypes, ...types]; + types = _getStructsAsCustomTypes(abiDefinition); break; } case 'function': { - const types = _getStructsAsCustomTypes(abiDefinition); - customTypes = [...customTypes, ...types]; + types = _getStructsAsCustomTypes(abiDefinition); break; } case 'event': @@ -147,6 +146,7 @@ function _extractStructs(compiledContract: StandardContractOutput): CustomType[] `unknown and unsupported AbiDefinition type '${(abiDefinition as AbiDefinition).type}'`, ); } + customTypes = [...customTypes, ...types]; } return customTypes; } |