diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2019-02-08 06:59:56 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2019-02-08 07:01:29 +0800 |
commit | b9ee9d2bd5b6aac11ccea5a71291e8885bbe6f7a (patch) | |
tree | c1bb8d38131ae5117754a7b2f7301f18fb40bef3 | |
parent | 21c3f75efcae5fd4f59df3dffe0af0ec59a163a7 (diff) | |
download | dexon-0x-contracts-b9ee9d2bd5b6aac11ccea5a71291e8885bbe6f7a.tar.gz dexon-0x-contracts-b9ee9d2bd5b6aac11ccea5a71291e8885bbe6f7a.tar.zst dexon-0x-contracts-b9ee9d2bd5b6aac11ccea5a71291e8885bbe6f7a.zip |
replaced typeof with _.isString
-rw-r--r-- | packages/utils/src/abi_encoder/evm_data_type_factory.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/utils/src/abi_encoder/evm_data_type_factory.ts b/packages/utils/src/abi_encoder/evm_data_type_factory.ts index 613eb887f..8e477f856 100644 --- a/packages/utils/src/abi_encoder/evm_data_type_factory.ts +++ b/packages/utils/src/abi_encoder/evm_data_type_factory.ts @@ -159,7 +159,7 @@ function consolidateDataItemsIntoSingle(input: DataItem | DataItem[] | string): components: dataItems, }; } else { - dataItem = typeof input === 'string' ? generateDataItemFromSignature(input) : (input as DataItem); + dataItem = _.isString(input) ? generateDataItemFromSignature(input) : (input as DataItem); } return dataItem; } @@ -201,7 +201,7 @@ function consolidateDataItemsIntoArray(input: DataItem | DataItem[] | string | s let dataItems: DataItem[]; if (_.isArray(input) && _.isEmpty(input)) { dataItems = []; - } else if (_.isArray(input) && typeof input[0] === 'string') { + } else if (_.isArray(input) && _.isString(input[0])) { dataItems = []; _.each(input as string[], (signature: string) => { const dataItem = generateDataItemFromSignature(signature); |