simplify inputParametersDeclarationToString code by using array.map

pull/1/head
Iuri Matias 7 years ago
parent c15e48d102
commit 9ed744a7a4
  1. 13
      src/app/execution/txHelper.js

@ -114,15 +114,8 @@ module.exports = {
}, },
inputParametersDeclarationToString: function (abiinputs) { inputParametersDeclarationToString: function (abiinputs) {
var inputs = '' var inputs = (abiinputs || []).map((inp) => inp.type + ' ' + inp.name)
if (abiinputs) { return inputs.join(', ')
abiinputs.forEach(function (i, inp) {
if (inputs !== '') {
inputs += ', '
}
inputs += inp.type + ' ' + inp.name
})
}
return inputs
} }
} }

Loading…
Cancel
Save