unify TimeTracker code, explicitly mark nullable playerCounts as unsafe

This commit is contained in:
Nick Krecklow
2020-05-11 18:29:26 -05:00
parent 7136851123
commit 903343fbdf
6 changed files with 62 additions and 44 deletions

11
lib/util.js Normal file
View File

@ -0,0 +1,11 @@
function getPlayerCountOrNull (resp) {
if (resp) {
return resp.players.online
} else {
return null
}
}
module.exports = {
getPlayerCountOrNull
}