aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-06 22:26:04 +0800
committerFabio Berger <me@fabioberger.com>2018-06-06 22:26:04 +0800
commitcf8fdd3a701f21bfc3b2ec8397fa65948f5cdc78 (patch)
tree1ab6a8d6b8588707286fc56a632dca9ceca7e7ac /packages/react-docs
parentaf1d5fce6ea355b12bf5f63f51ea81ff596f7868 (diff)
downloaddexon-sol-tools-cf8fdd3a701f21bfc3b2ec8397fa65948f5cdc78.tar
dexon-sol-tools-cf8fdd3a701f21bfc3b2ec8397fa65948f5cdc78.tar.gz
dexon-sol-tools-cf8fdd3a701f21bfc3b2ec8397fa65948f5cdc78.tar.bz2
dexon-sol-tools-cf8fdd3a701f21bfc3b2ec8397fa65948f5cdc78.tar.lz
dexon-sol-tools-cf8fdd3a701f21bfc3b2ec8397fa65948f5cdc78.tar.xz
dexon-sol-tools-cf8fdd3a701f21bfc3b2ec8397fa65948f5cdc78.tar.zst
dexon-sol-tools-cf8fdd3a701f21bfc3b2ec8397fa65948f5cdc78.zip
Move spawnSwitchErr to @0xproject/utils
Diffstat (limited to 'packages/react-docs')
-rw-r--r--packages/react-docs/src/components/custom_enum.tsx1
-rw-r--r--packages/react-docs/src/components/documentation.tsx1
-rw-r--r--packages/react-docs/src/components/type.tsx4
-rw-r--r--packages/react-docs/src/components/type_definition.tsx4
-rw-r--r--packages/react-docs/src/utils/typedoc_utils.ts4
-rw-r--r--packages/react-docs/src/utils/utils.ts5
6 files changed, 6 insertions, 13 deletions
diff --git a/packages/react-docs/src/components/custom_enum.tsx b/packages/react-docs/src/components/custom_enum.tsx
index 797372f35..c4252d9e2 100644
--- a/packages/react-docs/src/components/custom_enum.tsx
+++ b/packages/react-docs/src/components/custom_enum.tsx
@@ -3,7 +3,6 @@ import * as _ from 'lodash';
import * as React from 'react';
import { CustomType } from '../types';
-import { utils } from '../utils/utils';
const STRING_ENUM_CODE_PREFIX = ' strEnum(';
diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx
index 25687db67..f34d9f1fb 100644
--- a/packages/react-docs/src/components/documentation.tsx
+++ b/packages/react-docs/src/components/documentation.tsx
@@ -29,7 +29,6 @@ import {
TypescriptMethod,
} from '../types';
import { constants } from '../utils/constants';
-import { utils } from '../utils/utils';
import { Badge } from './badge';
import { Comment } from './comment';
diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx
index 2b7b49672..007d7da3e 100644
--- a/packages/react-docs/src/components/type.tsx
+++ b/packages/react-docs/src/components/type.tsx
@@ -1,4 +1,5 @@
import { colors, constants as sharedConstants, utils as sharedUtils } from '@0xproject/react-shared';
+import { errorUtils } from '@0xproject/utils';
import * as _ from 'lodash';
import * as React from 'react';
import { Link as ScrollLink } from 'react-scroll';
@@ -7,7 +8,6 @@ import * as ReactTooltip from 'react-tooltip';
import { DocsInfo } from '../docs_info';
import { Type as TypeDef, TypeDefinitionByName, TypeDocTypes } from '../types';
import { constants } from '../utils/constants';
-import { utils } from '../utils/utils';
import { Signature } from './signature';
import { TypeDefinition } from './type_definition';
@@ -140,7 +140,7 @@ export function Type(props: TypeProps): any {
break;
default:
- throw utils.spawnSwitchErr('type.typeDocType', type.typeDocType);
+ throw errorUtils.spawnSwitchErr('type.typeDocType', type.typeDocType);
}
// HACK: Normalize BigNumber to simply BigNumber. For some reason the type
// name is unpredictably one or the other.
diff --git a/packages/react-docs/src/components/type_definition.tsx b/packages/react-docs/src/components/type_definition.tsx
index a8e601ac2..f11b8f973 100644
--- a/packages/react-docs/src/components/type_definition.tsx
+++ b/packages/react-docs/src/components/type_definition.tsx
@@ -1,11 +1,11 @@
import { AnchorTitle, colors, HeaderSizes } from '@0xproject/react-shared';
+import { errorUtils } from '@0xproject/utils';
import * as _ from 'lodash';
import * as React from 'react';
import { DocsInfo } from '../docs_info';
import { CustomType, CustomTypeChild, EnumValue, KindString, TypeDocTypes } from '../types';
import { constants } from '../utils/constants';
-import { utils } from '../utils/utils';
import { Comment } from './comment';
import { CustomEnum } from './custom_enum';
@@ -96,7 +96,7 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef
break;
default:
- throw utils.spawnSwitchErr('type.kindString', customType.kindString);
+ throw errorUtils.spawnSwitchErr('type.kindString', customType.kindString);
}
const typeDefinitionAnchorId = `${this.props.sectionName}-${customType.name}`;
diff --git a/packages/react-docs/src/utils/typedoc_utils.ts b/packages/react-docs/src/utils/typedoc_utils.ts
index 5a672f10f..5633d9040 100644
--- a/packages/react-docs/src/utils/typedoc_utils.ts
+++ b/packages/react-docs/src/utils/typedoc_utils.ts
@@ -1,3 +1,4 @@
+import { errorUtils } from '@0xproject/utils';
import * as _ from 'lodash';
import { DocsInfo } from '../docs_info';
@@ -19,7 +20,6 @@ import {
TypescriptFunction,
TypescriptMethod,
} from '../types';
-import { utils } from '../utils/utils';
export const typeDocUtils = {
isType(entity: TypeDocNode): boolean {
@@ -197,7 +197,7 @@ export const typeDocUtils = {
break;
default:
- throw utils.spawnSwitchErr('kindString', entity.kindString);
+ throw errorUtils.spawnSwitchErr('kindString', entity.kindString);
}
});
return docSection;
diff --git a/packages/react-docs/src/utils/utils.ts b/packages/react-docs/src/utils/utils.ts
deleted file mode 100644
index e3dd1fc62..000000000
--- a/packages/react-docs/src/utils/utils.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const utils = {
- spawnSwitchErr(name: string, value: any): Error {
- return new Error(`Unexpected switch value: ${value} encountered for ${name}`);
- },
-};