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) {
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(', ')
}
}

Loading…
Cancel
Save