TIL: destructuring objects without let or const is a thing
This commit is contained in:
parent
2e4c9f6b7a
commit
7c454e5f44
2 changed files with 16 additions and 12 deletions
|
@ -162,12 +162,14 @@ class TransactionBuilder {
|
||||||
vin = signParams;
|
vin = signParams;
|
||||||
} else if (typeof signParams === 'object') {
|
} else if (typeof signParams === 'object') {
|
||||||
checkSignArgs(this, signParams);
|
checkSignArgs(this, signParams);
|
||||||
vin = signParams.vin;
|
({
|
||||||
keyPair = signParams.keyPair;
|
vin,
|
||||||
redeemScript = signParams.redeemScript;
|
keyPair,
|
||||||
hashType = signParams.hashType;
|
redeemScript,
|
||||||
witnessValue = signParams.witnessValue;
|
hashType,
|
||||||
witnessScript = signParams.witnessScript;
|
witnessValue,
|
||||||
|
witnessScript,
|
||||||
|
} = signParams);
|
||||||
} else {
|
} else {
|
||||||
throw new TypeError(
|
throw new TypeError(
|
||||||
'TransactionBuilder sign first arg must be TxbSignArg or number',
|
'TransactionBuilder sign first arg must be TxbSignArg or number',
|
||||||
|
|
|
@ -252,12 +252,14 @@ export class TransactionBuilder {
|
||||||
vin = signParams;
|
vin = signParams;
|
||||||
} else if (typeof signParams === 'object') {
|
} else if (typeof signParams === 'object') {
|
||||||
checkSignArgs(this, signParams);
|
checkSignArgs(this, signParams);
|
||||||
vin = signParams.vin;
|
({
|
||||||
keyPair = signParams.keyPair;
|
vin,
|
||||||
redeemScript = signParams.redeemScript;
|
keyPair,
|
||||||
hashType = signParams.hashType;
|
redeemScript,
|
||||||
witnessValue = signParams.witnessValue;
|
hashType,
|
||||||
witnessScript = signParams.witnessScript;
|
witnessValue,
|
||||||
|
witnessScript,
|
||||||
|
} = signParams);
|
||||||
} else {
|
} else {
|
||||||
throw new TypeError(
|
throw new TypeError(
|
||||||
'TransactionBuilder sign first arg must be TxbSignArg or number',
|
'TransactionBuilder sign first arg must be TxbSignArg or number',
|
||||||
|
|
Loading…
Reference in a new issue