aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-09-06 21:14:36 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-09-06 21:14:36 +0800
commit9680cc1270ad7a457331b4314daca397a23e9331 (patch)
tree131419d1c3129222bafe02d8f9ff2b9764a9d495
parent68d051d4a7ebf652bf909d1fa6bf7c639d138202 (diff)
downloaddexon-sol-tools-9680cc1270ad7a457331b4314daca397a23e9331.tar
dexon-sol-tools-9680cc1270ad7a457331b4314daca397a23e9331.tar.gz
dexon-sol-tools-9680cc1270ad7a457331b4314daca397a23e9331.tar.bz2
dexon-sol-tools-9680cc1270ad7a457331b4314daca397a23e9331.tar.lz
dexon-sol-tools-9680cc1270ad7a457331b4314daca397a23e9331.tar.xz
dexon-sol-tools-9680cc1270ad7a457331b4314daca397a23e9331.tar.zst
dexon-sol-tools-9680cc1270ad7a457331b4314daca397a23e9331.zip
Use _.includes instead of indexOf
-rw-r--r--src/utils/abi_decoder.ts12
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;
}
}