diff options
author | Fabio Berger <me@fabioberger.com> | 2018-08-22 00:48:24 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-08-22 00:48:24 +0800 |
commit | 809d301d582a01ff70958f380a7f8c4afe898366 (patch) | |
tree | 34dd7b0e18df47112ebfcf228032575851c9c715 /packages/react-docs/src/utils | |
parent | c00c477307e305e2d380779bb74fa29b31072c4c (diff) | |
download | dexon-sol-tools-809d301d582a01ff70958f380a7f8c4afe898366.tar.gz dexon-sol-tools-809d301d582a01ff70958f380a7f8c4afe898366.tar.zst dexon-sol-tools-809d301d582a01ff70958f380a7f8c4afe898366.zip |
Fix lowercase names involving ERC acronym
Diffstat (limited to 'packages/react-docs/src/utils')
-rw-r--r-- | packages/react-docs/src/utils/typedoc_utils.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/react-docs/src/utils/typedoc_utils.ts b/packages/react-docs/src/utils/typedoc_utils.ts index 8ee76c98c..0eaf5fd6e 100644 --- a/packages/react-docs/src/utils/typedoc_utils.ts +++ b/packages/react-docs/src/utils/typedoc_utils.ts @@ -374,11 +374,17 @@ export class TypeDocUtils { if (isConstructor || entityName === '__type') { callPath = ''; } else { - const prefix = isStatic ? sectionName : `${sectionName[0].toLowerCase()}${sectionName.slice(1)}`; + const prefix = isStatic ? sectionName : this._getLowercaseSectionName(sectionName); callPath = `${prefix}.`; } return callPath; } + private _getLowercaseSectionName(sectionName: string) { + if (_.startsWith(sectionName, 'ERC')) { + return `${sectionName.slice(0, 3).toLowerCase()}${sectionName.slice(3)}`; + } + return `${sectionName[0].toLowerCase()}${sectionName.slice(1)}`; + } private _convertFunction(entity: TypeDocNode, sectionName: string, isObjectLiteral: boolean): TypescriptFunction { const signature = entity.signatures[0]; const source = entity.sources[0]; |