Replace lodash with built-ins where possible to reduce bundle size (#1766)

* add tslint rule to disallow lodash.isUndefined

* add tslint rule to disallow lodash.isNull

* apply fixes
This commit is contained in:
Xianny
2019-04-10 09:36:32 -07:00
committed by GitHub
parent 49d951b7be
commit 7423028fea
299 changed files with 1249 additions and 1038 deletions

View File

@@ -1,7 +1,6 @@
import { LogDecoder, txDefaults } from '@0x/contracts-test-utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { TransactionReceiptWithDecodedLogs, ZeroExProvider } from 'ethereum-types';
import * as _ from 'lodash';
import { artifacts, CoordinatorRegistryContract } from '../../src';
@@ -26,7 +25,7 @@ export class CoordinatorRegistryWrapper {
this._provider,
txDefaults,
);
if (_.isUndefined(this._coordinatorRegistryContract)) {
if (this._coordinatorRegistryContract === undefined) {
throw new Error(`Failed to deploy Coordinator Registry contract.`);
}
return this._coordinatorRegistryContract;
@@ -56,7 +55,7 @@ export class CoordinatorRegistryWrapper {
return coordinatorEndpoint;
}
private _assertCoordinatorRegistryDeployed(): void {
if (_.isUndefined(this._coordinatorRegistryContract)) {
if (this._coordinatorRegistryContract === undefined) {
throw new Error(
'The Coordinator Registry contract was not deployed through the CoordinatorRegistryWrapper. Call `deployCoordinatorRegistryAsync` to deploy.',
);