diff options
Diffstat (limited to 'packages/connect/src/utils')
-rw-r--r-- | packages/connect/src/utils/orderbook_channel_message_parsers.ts | 15 | ||||
-rw-r--r-- | packages/connect/src/utils/type_converters.ts | 2 |
2 files changed, 7 insertions, 10 deletions
diff --git a/packages/connect/src/utils/orderbook_channel_message_parsers.ts b/packages/connect/src/utils/orderbook_channel_message_parsers.ts index d9a84cca2..a4f22dc4b 100644 --- a/packages/connect/src/utils/orderbook_channel_message_parsers.ts +++ b/packages/connect/src/utils/orderbook_channel_message_parsers.ts @@ -1,13 +1,10 @@ -import {assert} from '@0xproject/assert'; -import {schemas} from '@0xproject/json-schemas'; +import { assert } from '@0xproject/assert'; +import { schemas } from '@0xproject/json-schemas'; import * as _ from 'lodash'; -import { - OrderbookChannelMessage, - OrderbookChannelMessageTypes, -} from '../types'; +import { OrderbookChannelMessage, OrderbookChannelMessageTypes } from '../types'; -import {typeConverters} from './type_converters'; +import { typeConverters } from './type_converters'; export const orderbookChannelMessageParsers = { parser(utf8Data: string): OrderbookChannelMessage { @@ -16,13 +13,13 @@ export const orderbookChannelMessageParsers = { assert.assert(!_.isUndefined(type), `Message is missing a type parameter: ${utf8Data}`); assert.isString('type', type); switch (type) { - case (OrderbookChannelMessageTypes.Snapshot): { + case OrderbookChannelMessageTypes.Snapshot: { assert.doesConformToSchema('message', messageObj, schemas.relayerApiOrderbookChannelSnapshotSchema); const orderbook = messageObj.payload; typeConverters.convertOrderbookStringFieldsToBigNumber(orderbook); return messageObj; } - case (OrderbookChannelMessageTypes.Update): { + case OrderbookChannelMessageTypes.Update: { assert.doesConformToSchema('message', messageObj, schemas.relayerApiOrderbookChannelUpdateSchema); const order = messageObj.payload; typeConverters.convertOrderStringFieldsToBigNumber(order); diff --git a/packages/connect/src/utils/type_converters.ts b/packages/connect/src/utils/type_converters.ts index 28810af1a..ccbc40677 100644 --- a/packages/connect/src/utils/type_converters.ts +++ b/packages/connect/src/utils/type_converters.ts @@ -1,4 +1,4 @@ -import {BigNumber} from 'bignumber.js'; +import { BigNumber } from 'bignumber.js'; import * as _ from 'lodash'; // TODO: convert all of these to non-mutating, pure functions |