aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-14 01:39:36 +0800
committerFabio Berger <me@fabioberger.com>2017-11-14 01:39:36 +0800
commita072954176ef6b943e45a515ec6d97a662d67a28 (patch)
treea3f884aaf5feb958a8412bec2ad31e4ae77ed708
parent23de8185c62f0879c20a7ece50aa35323aec92e3 (diff)
downloaddexon-sol-tools-a072954176ef6b943e45a515ec6d97a662d67a28.tar
dexon-sol-tools-a072954176ef6b943e45a515ec6d97a662d67a28.tar.gz
dexon-sol-tools-a072954176ef6b943e45a515ec6d97a662d67a28.tar.bz2
dexon-sol-tools-a072954176ef6b943e45a515ec6d97a662d67a28.tar.lz
dexon-sol-tools-a072954176ef6b943e45a515ec6d97a662d67a28.tar.xz
dexon-sol-tools-a072954176ef6b943e45a515ec6d97a662d67a28.tar.zst
dexon-sol-tools-a072954176ef6b943e45a515ec6d97a662d67a28.zip
Replace _.get for type safety
-rw-r--r--packages/0x.js/src/order_watcher/order_state_watcher.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/0x.js/src/order_watcher/order_state_watcher.ts b/packages/0x.js/src/order_watcher/order_state_watcher.ts
index 139f13fdf..e621e0b6e 100644
--- a/packages/0x.js/src/order_watcher/order_state_watcher.ts
+++ b/packages/0x.js/src/order_watcher/order_state_watcher.ts
@@ -143,9 +143,9 @@ export class OrderStateWatcher {
// Revalidate orders
makerToken = decodedLog.address;
makerAddress = args._owner;
- orderHashesSet = _.get(this._dependentOrderHashes, [makerAddress, makerToken]);
- if (!_.isUndefined(orderHashesSet)) {
- const orderHashes = Array.from(orderHashesSet);
+ if (!_.isUndefined(this._dependentOrderHashes[makerAddress]) &&
+ !_.isUndefined(this._dependentOrderHashes[makerAddress][makerToken])) {
+ const orderHashes = Array.from(this._dependentOrderHashes[makerAddress][makerToken]);
await this._emitRevalidateOrdersAsync(orderHashes);
}
break;
@@ -159,9 +159,9 @@ export class OrderStateWatcher {
// Revalidate orders
makerToken = decodedLog.address;
makerAddress = args._from;
- orderHashesSet = _.get(this._dependentOrderHashes, [makerAddress, makerToken]);
- if (!_.isUndefined(orderHashesSet)) {
- const orderHashes = Array.from(orderHashesSet);
+ if (!_.isUndefined(this._dependentOrderHashes[makerAddress]) &&
+ !_.isUndefined(this._dependentOrderHashes[makerAddress][makerToken])) {
+ const orderHashes = Array.from(this._dependentOrderHashes[makerAddress][makerToken]);
await this._emitRevalidateOrdersAsync(orderHashes);
}
break;