diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-09-06 21:14:36 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-09-06 21:14:36 +0800 |
commit | 9680cc1270ad7a457331b4314daca397a23e9331 (patch) | |
tree | 131419d1c3129222bafe02d8f9ff2b9764a9d495 /src | |
parent | 68d051d4a7ebf652bf909d1fa6bf7c639d138202 (diff) | |
download | dexon-0x-contracts-9680cc1270ad7a457331b4314daca397a23e9331.tar.gz dexon-0x-contracts-9680cc1270ad7a457331b4314daca397a23e9331.tar.zst dexon-0x-contracts-9680cc1270ad7a457331b4314daca397a23e9331.zip |
Use _.includes instead of indexOf
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/abi_decoder.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/abi_decoder.ts b/src/utils/abi_decoder.ts index 902799341..05389a05f 100644 --- a/src/utils/abi_decoder.ts +++ b/src/utils/abi_decoder.ts @@ -55,12 +55,12 @@ export class AbiDecoder { this.savedABIs = this.savedABIs.concat(abiArray); } private padZeros(address: string) { - let formatted = address; - if (formatted.indexOf('0x') !== -1) { - formatted = formatted.slice(2); - } + let formatted = address; + if (!_.includes(formatted, '0x')) { + formatted = formatted.slice(2); + } - formatted = _.padStart(formatted, 40, '0'); - return '0x' + formatted; + formatted = _.padStart(formatted, 40, '0'); + return '0x' + formatted; } } |