diff options
author | Fabio Berger <me@fabioberger.com> | 2018-08-04 01:45:09 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-08-04 01:45:09 +0800 |
commit | d9f09b5e1e7ecc8dc56ac7184cfc0152b3c2ff32 (patch) | |
tree | d5320bec7fa841b1c5cace2c9af333c0c8ca1557 /packages/react-docs/src/docs_info.ts | |
parent | 9337d207a1f4d5c28b42d1364a2a8bdc0dc841cf (diff) | |
download | dexon-0x-contracts-d9f09b5e1e7ecc8dc56ac7184cfc0152b3c2ff32.tar dexon-0x-contracts-d9f09b5e1e7ecc8dc56ac7184cfc0152b3c2ff32.tar.gz dexon-0x-contracts-d9f09b5e1e7ecc8dc56ac7184cfc0152b3c2ff32.tar.bz2 dexon-0x-contracts-d9f09b5e1e7ecc8dc56ac7184cfc0152b3c2ff32.tar.lz dexon-0x-contracts-d9f09b5e1e7ecc8dc56ac7184cfc0152b3c2ff32.tar.xz dexon-0x-contracts-d9f09b5e1e7ecc8dc56ac7184cfc0152b3c2ff32.tar.zst dexon-0x-contracts-d9f09b5e1e7ecc8dc56ac7184cfc0152b3c2ff32.zip |
Make rendering of individually exported functions lighter-weight
Diffstat (limited to 'packages/react-docs/src/docs_info.ts')
-rw-r--r-- | packages/react-docs/src/docs_info.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/react-docs/src/docs_info.ts b/packages/react-docs/src/docs_info.ts index 0637f3e65..36a6a7301 100644 --- a/packages/react-docs/src/docs_info.ts +++ b/packages/react-docs/src/docs_info.ts @@ -52,10 +52,20 @@ export class DocsInfo { return; // no-op } + const isExportedFunctionSection = + docSection.functions.length === 1 && + _.isEmpty(docSection.types) && + _.isEmpty(docSection.methods) && + _.isEmpty(docSection.constructors) && + _.isEmpty(docSection.properties) && + _.isEmpty(docSection.events); + if (!_.isUndefined(this.sections.types) && sectionName === this.sections.types) { const sortedTypesNames = _.sortBy(docSection.types, 'name'); const typeNames = _.map(sortedTypesNames, t => t.name); menuSubsectionsBySection[sectionName] = typeNames; + } else if (isExportedFunctionSection) { + // Noop so that we don't have the method listed underneath itself. } else { let eventNames: string[] = []; if (!_.isUndefined(docSection.events)) { @@ -76,6 +86,7 @@ export class DocsInfo { ]; } }); + console.log('menuSubsectionsBySection', menuSubsectionsBySection); return menuSubsectionsBySection; } public getTypeDefinitionsByName(docAgnosticFormat: DocAgnosticFormat): { [name: string]: TypeDefinitionByName } { |