From 40a7be0690c81d2e42543aa075ef8da6606e7b7e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 21 Jun 2017 13:56:14 +0200 Subject: Use different lodash import syntax which allows to include only used functions --- test/utils/token_utils.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'test/utils/token_utils.ts') diff --git a/test/utils/token_utils.ts b/test/utils/token_utils.ts index f4fa7ac31..658cfe864 100644 --- a/test/utils/token_utils.ts +++ b/test/utils/token_utils.ts @@ -1,4 +1,6 @@ -import * as _ from 'lodash'; +import find from 'lodash/find'; +import filter from 'lodash/filter'; +import isUndefined from 'lodash/isUndefined'; import {Token, ZeroExError} from '../../src'; const PROTOCOL_TOKEN_SYMBOL = 'ZRX'; @@ -9,14 +11,14 @@ export class TokenUtils { this.tokens = tokens; } public getProtocolTokenOrThrow(): Token { - const zrxToken = _.find(this.tokens, {symbol: PROTOCOL_TOKEN_SYMBOL}); - if (_.isUndefined(zrxToken)) { + const zrxToken = find(this.tokens, {symbol: PROTOCOL_TOKEN_SYMBOL}); + if (isUndefined(zrxToken)) { throw new Error(ZeroExError.ZRX_NOT_IN_TOKEN_REGISTRY); } return zrxToken; } public getNonProtocolTokens(): Token[] { - const nonProtocolTokens = _.filter(this.tokens, token => { + const nonProtocolTokens = filter(this.tokens, token => { return token.symbol !== PROTOCOL_TOKEN_SYMBOL; }); return nonProtocolTokens; -- cgit v1.2.3