aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/utils.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-21 19:56:14 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-21 19:56:14 +0800
commit40a7be0690c81d2e42543aa075ef8da6606e7b7e (patch)
tree73231f3671133364b53d55074f27e03bd61a1d38 /src/utils/utils.ts
parent096d3bdb26921cb3e7d05e65dc286ddf49f98a8a (diff)
downloaddexon-sol-tools-40a7be0690c81d2e42543aa075ef8da6606e7b7e.tar.gz
dexon-sol-tools-40a7be0690c81d2e42543aa075ef8da6606e7b7e.tar.zst
dexon-sol-tools-40a7be0690c81d2e42543aa075ef8da6606e7b7e.zip
Use different lodash import syntax which allows to include only used functions
Diffstat (limited to 'src/utils/utils.ts')
-rw-r--r--src/utils/utils.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/utils/utils.ts b/src/utils/utils.ts
index bad5b6498..e4e7b77ab 100644
--- a/src/utils/utils.ts
+++ b/src/utils/utils.ts
@@ -1,4 +1,5 @@
-import * as _ from 'lodash';
+import map from 'lodash/map';
+import includes from 'lodash/includes';
import * as BN from 'bn.js';
import * as ethABI from 'ethereumjs-abi';
import * as ethUtil from 'ethereumjs-util';
@@ -20,7 +21,7 @@ export const utils = {
console.log(message);
},
isParityNode(nodeVersion: string): boolean {
- return _.includes(nodeVersion, 'Parity');
+ return includes(nodeVersion, 'Parity');
},
isValidOrderHash(orderHashHex: string): boolean {
const isValid = /^0x[0-9A-F]{64}$/i.test(orderHashHex);
@@ -44,8 +45,8 @@ export const utils = {
{value: utils.bigNumberToBN(order.expirationUnixTimestampSec), type: SolidityTypes.uint256},
{value: utils.bigNumberToBN(order.salt), type: SolidityTypes.uint256},
];
- const types = _.map(orderParts, o => o.type);
- const values = _.map(orderParts, o => o.value);
+ const types = map(orderParts, o => o.type);
+ const values = map(orderParts, o => o.value);
const hashBuff = ethABI.soliditySHA3(types, values);
const hashHex = ethUtil.bufferToHex(hashBuff);
return hashHex;