Replace switch with if..else if..else
@@ -186,17 +186,11 @@ export class Client {
const rawTransactions = await this.blockExplorerClient.getAccountTransactions(address, offset, limit);
const transactions = rawTransactions.filter((tx) => {
const type = tx.tx.type || '';
- switch (true) {
- case type == 'Deposit': {
+ if (type == 'Deposit') {
return tx.tx.priority_op.to == address;
- }
- case type == 'Withdraw': {
+ } else if (type == 'Withdraw') {
return tx.tx.from == address;
- }
- default: {
- return true;
- }
- }
+ } else return true;
});
const res = transactions.map(async (tx) => {
const type = tx.tx.type || '';
