aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-03 17:44:50 +0800
committerFabio Berger <me@fabioberger.com>2018-08-03 17:44:50 +0800
commit4a2a22a43b5d904834cddae5768d9adf3efedf30 (patch)
treec5c58dafd0853d690d79db8f50db5c9e1744d764
parent47584b18e975215ec01a5de3b4bf88d9cd15ee59 (diff)
downloaddexon-sol-tools-4a2a22a43b5d904834cddae5768d9adf3efedf30.tar
dexon-sol-tools-4a2a22a43b5d904834cddae5768d9adf3efedf30.tar.gz
dexon-sol-tools-4a2a22a43b5d904834cddae5768d9adf3efedf30.tar.bz2
dexon-sol-tools-4a2a22a43b5d904834cddae5768d9adf3efedf30.tar.lz
dexon-sol-tools-4a2a22a43b5d904834cddae5768d9adf3efedf30.tar.xz
dexon-sol-tools-4a2a22a43b5d904834cddae5768d9adf3efedf30.tar.zst
dexon-sol-tools-4a2a22a43b5d904834cddae5768d9adf3efedf30.zip
Refactor logic for clarity
-rw-r--r--packages/react-docs/src/utils/typedoc_utils.ts17
1 files changed, 11 insertions, 6 deletions
diff --git a/packages/react-docs/src/utils/typedoc_utils.ts b/packages/react-docs/src/utils/typedoc_utils.ts
index f1f42c36d..ad794c0fa 100644
--- a/packages/react-docs/src/utils/typedoc_utils.ts
+++ b/packages/react-docs/src/utils/typedoc_utils.ts
@@ -437,18 +437,23 @@ export const typeDocUtils = {
return typeDocUtils._convertType(t, sections, sectionName, docId);
});
- const isConstructor = false;
+ let indexSignatureIfExists;
+ let methodIfExists;
const doesIndexSignatureExist =
!_.isUndefined(entity.declaration) && !_.isUndefined(entity.declaration.indexSignature);
- let indexSignatureIfExists;
if (doesIndexSignatureExist) {
const indexSignature = entity.declaration.indexSignature as TypeDocNode;
indexSignatureIfExists = typeDocUtils._convertIndexSignature(indexSignature, sections, sectionName, docId);
+ } else if (!_.isUndefined(entity.declaration)) {
+ const isConstructor = false;
+ methodIfExists = typeDocUtils._convertMethod(
+ entity.declaration,
+ isConstructor,
+ sections,
+ sectionName,
+ docId,
+ );
}
- const methodIfExists =
- !_.isUndefined(entity.declaration) && !doesIndexSignatureExist
- ? typeDocUtils._convertMethod(entity.declaration, isConstructor, sections, sectionName, docId)
- : undefined;
const elementTypeIfExists = !_.isUndefined(entity.elementType)
? {