Merge pull request #2567 from 0xProject/fix/instanceof-array-isArray

instanceof Array -> Array.isArray
This commit is contained in:
mzhu25 2020-04-28 01:03:02 -07:00 committed by GitHub
commit a90b463a7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -13,6 +13,10 @@
{
"note": "`ZeroExRevertErrors.Migrate` -> `ZeroExRevertErrors.Ownable`",
"pr": 2564
},
{
"note": "`instanceof Array` => `Array.isArray`",
"pr": 2567
}
]
},

View File

@ -43,10 +43,9 @@ export abstract class AbstractSetDataType extends DataType {
}
public generateCalldataBlock(value: any[] | object, parentBlock?: CalldataBlock): SetCalldataBlock {
const block =
value instanceof Array
? this._generateCalldataBlockFromArray(value, parentBlock)
: this._generateCalldataBlockFromObject(value, parentBlock);
const block = Array.isArray(value)
? this._generateCalldataBlockFromArray(value, parentBlock)
: this._generateCalldataBlockFromObject(value, parentBlock);
return block;
}