aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/utils/typedoc_utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/react-docs/src/utils/typedoc_utils.ts')
-rw-r--r--packages/react-docs/src/utils/typedoc_utils.ts19
1 files changed, 12 insertions, 7 deletions
diff --git a/packages/react-docs/src/utils/typedoc_utils.ts b/packages/react-docs/src/utils/typedoc_utils.ts
index f44945369..19605d497 100644
--- a/packages/react-docs/src/utils/typedoc_utils.ts
+++ b/packages/react-docs/src/utils/typedoc_utils.ts
@@ -1,7 +1,3 @@
-import { errorUtils } from '@0xproject/utils';
-import * as _ from 'lodash';
-
-import { DocsInfo } from '../docs_info';
import {
CustomType,
CustomTypeChild,
@@ -11,7 +7,6 @@ import {
ExternalTypeToLink,
GeneratedDocJson,
IndexSignature,
- KindString,
Parameter,
Property,
Type,
@@ -21,7 +16,12 @@ import {
TypeParameter,
TypescriptFunction,
TypescriptMethod,
-} from '../types';
+} from '@0xproject/types';
+import { errorUtils } from '@0xproject/utils';
+import * as _ from 'lodash';
+
+import { DocsInfo } from '../docs_info';
+import { KindString } from '../types';
import { constants } from './constants';
@@ -419,7 +419,10 @@ export class TypeDocUtils {
return func;
}
private _convertTypeParameter(entity: TypeDocNode, sectionName: string): TypeParameter {
- const type = this._convertType(entity.type, sectionName);
+ let type;
+ if (!_.isUndefined(entity.type)) {
+ type = this._convertType(entity.type, sectionName);
+ }
const parameter = {
name: entity.name,
type,
@@ -468,6 +471,8 @@ export class TypeDocUtils {
methodIfExists = this._convertMethod(entity.declaration, isConstructor, sectionName);
} else if (entity.type === TypeDocTypes.Tuple) {
tupleElementsIfExists = _.map(entity.elements, el => {
+ // the following line is required due to an open tslint issue, https://github.com/palantir/tslint/issues/3540
+ // tslint:disable-next-line:no-unnecessary-type-assertion
return { name: el.name, typeDocType: el.type as TypeDocTypes };
});
}