Skip to content

Commit

Permalink
refactor: move locale constants into enums
Browse files Browse the repository at this point in the history
  • Loading branch information
nolddor committed Mar 23, 2024
1 parent e5e6f14 commit 33f830c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions enum/ELocales.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = Object.freeze({
en_US: 'en-US'
})
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const JSONStorage = require('./lib/JSONStorage')
const Logger = require('./lib/Logger')
const EFolders = require('./enum/EFolders')
const EFiles = require('./enum/EFiles')
const ELocales = require('./enum/ELocales')

async function main() {
Logger.info('Connecting to SteamCardExchange...')
Expand All @@ -11,7 +12,8 @@ async function main() {
const badges = { ...cache, ...sce }

const count = Object.keys(badges).length
Logger.info(`Found ${count.toLocaleString('en-US')} Steam apps having trading cards.`)
const countAsString = count.toLocaleString(ELocales.en_US)
Logger.info(`Found ${countAsString} Steam apps having trading cards.`)

JSONStorage.writeSync(EFolders.DATA, EFiles.BADGES, badges, { minify: false })
JSONStorage.writeSync(EFolders.DATA, EFiles.BADGES_MIN, badges)
Expand Down

0 comments on commit 33f830c

Please sign in to comment.