mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00:00
chore(protocol/battlefield): replace if condition many ors with includes
This commit is contained in:
parent
a2835108d6
commit
7c774ac403
1 changed files with 1 additions and 10 deletions
|
|
@ -85,16 +85,7 @@ export default class battlefield extends Core {
|
||||||
if (key === 'teamId') key = 'team'
|
if (key === 'teamId') key = 'team'
|
||||||
else if (key === 'squadId') key = 'squad'
|
else if (key === 'squadId') key = 'squad'
|
||||||
|
|
||||||
if (
|
if (['kills', 'deaths', 'score', 'rank', 'team', 'squad', 'ping', 'type'].includes(key)) {
|
||||||
key === 'kills' ||
|
|
||||||
key === 'deaths' ||
|
|
||||||
key === 'score' ||
|
|
||||||
key === 'rank' ||
|
|
||||||
key === 'team' ||
|
|
||||||
key === 'squad' ||
|
|
||||||
key === 'ping' ||
|
|
||||||
key === 'type'
|
|
||||||
) {
|
|
||||||
value = parseInt(value)
|
value = parseInt(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue