# all files / lib/Utils/ RegionHelper.js

100% Statements 12/12
100% Branches 0/0
100% Functions 0/0
100% Lines 8/8

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    161×
    1×

    1×
    3×
    15×

    1×

    137×

    1×
     import regions from 'Enums/regions'
    import platformIDs from 'Enums/platform-ids'

    const regionKeys = Object.keys(regions)
    const asPlatformID = regionAbbr => platformIDs[regionKeys.find(eq(regionAbbr))]
    const isValidRegion = val => regionKeys.some(eq(val))

    const RegionHelper = {
        asPlatformID,
        isValidRegion,
    }

    const eq = v => k => regions[k] === v

    export default RegionHelper