From c9b29645460f9d56075c07ed8107552814f1c880 Mon Sep 17 00:00:00 2001 From: Luke Childs <lukechilds123@gmail.com> Date: Sun, 26 Apr 2020 15:37:57 +0700 Subject: [PATCH] Remove extra return statement --- src/psbt.js | 26 +++++++++++--------------- ts_src/psbt.ts | 26 +++++++++++--------------- 2 files changed, 22 insertions(+), 30 deletions(-) diff --git a/src/psbt.js b/src/psbt.js index 4331ae5..a3ee29b 100644 --- a/src/psbt.js +++ b/src/psbt.js @@ -104,23 +104,19 @@ class Psbt { return this.__CACHE.__TX.locktime; } get inputs() { - return this.__CACHE.__TX.ins.map(input => { - return { - hash: bufferutils_1.cloneBuffer(input.hash), - index: input.index, - script: bufferutils_1.cloneBuffer(input.script), - sequence: input.sequence, - witness: input.witness.map(buffer => bufferutils_1.cloneBuffer(buffer)), - }; - }); + return this.__CACHE.__TX.ins.map(input => ({ + hash: bufferutils_1.cloneBuffer(input.hash), + index: input.index, + script: bufferutils_1.cloneBuffer(input.script), + sequence: input.sequence, + witness: input.witness.map(buffer => bufferutils_1.cloneBuffer(buffer)), + })); } get outputs() { - return this.__CACHE.__TX.outs.map(output => { - return { - script: bufferutils_1.cloneBuffer(output.script), - value: output.value, - }; - }); + return this.__CACHE.__TX.outs.map(output => ({ + script: bufferutils_1.cloneBuffer(output.script), + value: output.value, + })); } combine(...those) { this.data.combine(...those.map(o => o.data)); diff --git a/ts_src/psbt.ts b/ts_src/psbt.ts index 705e4be..0fd177b 100644 --- a/ts_src/psbt.ts +++ b/ts_src/psbt.ts @@ -138,24 +138,20 @@ export class Psbt { } get inputs(): Input[] { - return this.__CACHE.__TX.ins.map(input => { - return { - hash: cloneBuffer(input.hash), - index: input.index, - script: cloneBuffer(input.script), - sequence: input.sequence, - witness: input.witness.map(buffer => cloneBuffer(buffer)), - }; - }); + return this.__CACHE.__TX.ins.map(input => ({ + hash: cloneBuffer(input.hash), + index: input.index, + script: cloneBuffer(input.script), + sequence: input.sequence, + witness: input.witness.map(buffer => cloneBuffer(buffer)), + })); } get outputs(): Output[] { - return this.__CACHE.__TX.outs.map(output => { - return { - script: cloneBuffer(output.script), - value: output.value, - }; - }); + return this.__CACHE.__TX.outs.map(output => ({ + script: cloneBuffer(output.script), + value: output.value, + })); } combine(...those: Psbt[]): this {