diff options
author | Fabio Berger <me@fabioberger.com> | 2018-09-28 17:30:24 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-09-28 17:30:24 +0800 |
commit | 28f5cd06418e52a80fb784dbed75120d76b4204b (patch) | |
tree | 101c02fca95fd4d4bf4e68c741a2920198f91393 | |
parent | 144561c53be3df1e03cd46de23cec4710056907a (diff) | |
download | dexon-sol-tools-28f5cd06418e52a80fb784dbed75120d76b4204b.tar.gz dexon-sol-tools-28f5cd06418e52a80fb784dbed75120d76b4204b.tar.zst dexon-sol-tools-28f5cd06418e52a80fb784dbed75120d76b4204b.zip |
Only add Stucts section if there are any
-rw-r--r-- | packages/sol-doc/src/solidity_doc_generator.ts | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/packages/sol-doc/src/solidity_doc_generator.ts b/packages/sol-doc/src/solidity_doc_generator.ts index 09137c4cf..424577411 100644 --- a/packages/sol-doc/src/solidity_doc_generator.ts +++ b/packages/sol-doc/src/solidity_doc_generator.ts @@ -90,15 +90,17 @@ export async function generateSolDocAsync( } } - doc.structs = { - comment: '', - constructors: [], - methods: [], - properties: [], - types: structs, - functions: [], - events: [], - }; + if (structs.length > 0) { + doc.structs = { + comment: '', + constructors: [], + methods: [], + properties: [], + types: structs, + functions: [], + events: [], + }; + } return doc; } |