diff options
author | Fabio Berger <me@fabioberger.com> | 2017-11-14 01:39:36 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-11-14 01:39:36 +0800 |
commit | a072954176ef6b943e45a515ec6d97a662d67a28 (patch) | |
tree | a3f884aaf5feb958a8412bec2ad31e4ae77ed708 | |
parent | 23de8185c62f0879c20a7ece50aa35323aec92e3 (diff) | |
download | dexon-0x-contracts-a072954176ef6b943e45a515ec6d97a662d67a28.tar.gz dexon-0x-contracts-a072954176ef6b943e45a515ec6d97a662d67a28.tar.zst dexon-0x-contracts-a072954176ef6b943e45a515ec6d97a662d67a28.zip |
Replace _.get for type safety
-rw-r--r-- | packages/0x.js/src/order_watcher/order_state_watcher.ts | 12 |
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; |