aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-09-28 17:30:24 +0800
committerFabio Berger <me@fabioberger.com>2018-09-28 17:30:24 +0800
commit28f5cd06418e52a80fb784dbed75120d76b4204b (patch)
tree101c02fca95fd4d4bf4e68c741a2920198f91393
parent144561c53be3df1e03cd46de23cec4710056907a (diff)
downloaddexon-sol-tools-28f5cd06418e52a80fb784dbed75120d76b4204b.tar
dexon-sol-tools-28f5cd06418e52a80fb784dbed75120d76b4204b.tar.gz
dexon-sol-tools-28f5cd06418e52a80fb784dbed75120d76b4204b.tar.bz2
dexon-sol-tools-28f5cd06418e52a80fb784dbed75120d76b4204b.tar.lz
dexon-sol-tools-28f5cd06418e52a80fb784dbed75120d76b4204b.tar.xz
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.ts20
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;
}