From 28f5cd06418e52a80fb784dbed75120d76b4204b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 28 Sep 2018 10:30:24 +0100 Subject: Only add Stucts section if there are any --- packages/sol-doc/src/solidity_doc_generator.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'packages/sol-doc') 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; } -- cgit