From a2f57f2590c3f2b692577343e2404a491007dd8c Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 2 Feb 2018 12:41:58 -0500 Subject: [PATCH] simplify inputParametersDeclarationToString code by using array.map --- src/app/execution/txHelper.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/app/execution/txHelper.js b/src/app/execution/txHelper.js index b00f565537..f11a9247e9 100644 --- a/src/app/execution/txHelper.js +++ b/src/app/execution/txHelper.js @@ -114,15 +114,8 @@ module.exports = { }, inputParametersDeclarationToString: function (abiinputs) { - var inputs = '' - if (abiinputs) { - abiinputs.forEach(function (i, inp) { - if (inputs !== '') { - inputs += ', ' - } - inputs += inp.type + ' ' + inp.name - }) - } - return inputs + var inputs = (abiinputs || []).map((inp) => inp.type + ' ' + inp.name) + return inputs.join(', ') } + }