From 9680cc1270ad7a457331b4314daca397a23e9331 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 6 Sep 2017 15:14:36 +0200 Subject: Use _.includes instead of indexOf --- src/utils/abi_decoder.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') 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; } } -- cgit v1.2.3