diff options
author | Fabio Berger <me@fabioberger.com> | 2018-09-28 06:20:21 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-09-28 06:20:21 +0800 |
commit | e0ff3484cf169162f3a339b6cb779fa2b562ad73 (patch) | |
tree | 09b2f9c895138fda8bfdc4d44b36bc450d31c1ed /packages/sol-doc | |
parent | 95e84aae49d86ed8edf286bc8c95214f5b2456c7 (diff) | |
download | dexon-sol-tools-e0ff3484cf169162f3a339b6cb779fa2b562ad73.tar.gz dexon-sol-tools-e0ff3484cf169162f3a339b6cb779fa2b562ad73.tar.zst dexon-sol-tools-e0ff3484cf169162f3a339b6cb779fa2b562ad73.zip |
Improve switch case
Diffstat (limited to 'packages/sol-doc')
-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; } |