From 809d301d582a01ff70958f380a7f8c4afe898366 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 21 Aug 2018 17:48:24 +0100 Subject: Fix lowercase names involving ERC acronym --- packages/react-docs/src/utils/typedoc_utils.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'packages/react-docs') 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]; -- cgit v1.2.3