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;
|
||||
} else if (typeof signParams === 'object') {
|
||||
checkSignArgs(this, signParams);
|
||||
vin = signParams.vin;
|
||||
keyPair = signParams.keyPair;
|
||||
redeemScript = signParams.redeemScript;
|
||||
hashType = signParams.hashType;
|
||||
witnessValue = signParams.witnessValue;
|
||||
witnessScript = signParams.witnessScript;
|
||||
({
|
||||
vin,
|
||||
keyPair,
|
||||
redeemScript,
|
||||
hashType,
|
||||
witnessValue,
|
||||
witnessScript,
|
||||
} = signParams);
|
||||
} else {
|
||||
throw new TypeError(
|
||||
'TransactionBuilder sign first arg must be TxbSignArg or number',
|
||||
|
|
|
@ -252,12 +252,14 @@ export class TransactionBuilder {
|
|||
vin = signParams;
|
||||
} else if (typeof signParams === 'object') {
|
||||
checkSignArgs(this, signParams);
|
||||
vin = signParams.vin;
|
||||
keyPair = signParams.keyPair;
|
||||
redeemScript = signParams.redeemScript;
|
||||
hashType = signParams.hashType;
|
||||
witnessValue = signParams.witnessValue;
|
||||
witnessScript = signParams.witnessScript;
|
||||
({
|
||||
vin,
|
||||
keyPair,
|
||||
redeemScript,
|
||||
hashType,
|
||||
witnessValue,
|
||||
witnessScript,
|
||||
} = signParams);
|
||||
} else {
|
||||
throw new TypeError(
|
||||
'TransactionBuilder sign first arg must be TxbSignArg or number',
|
||||
|
|
Loading…
Reference in a new issue