# All files / src/lib config.ts

100% Statements 24/24
100% Branches 4/4
100% Functions 1/1
100% Lines 24/24

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    251x
    1x
    1x
    1x
    1x
    1x
    1x
    30x
    30x
    24x
    24x
    6x
    6x
    6x
    1x
    1x
    1x
    1x
    1x
    114x
    114x
    114x
    1x
    1x
     import stringsData from '@/config/strings.json'
    import appConfigData from '@/config/app-config.json'

    export const strings = stringsData
    export const appConfig = appConfigData

    export function getLanguageColor(language: string): string {
      const colors = appConfig.languageColors[language as keyof typeof appConfig.languageColors]
      if (colors) {
        return `${colors.bg} ${colors.text} ${colors.border}`
      }
      const defaultColors = appConfig.languageColors.Other
      return `${defaultColors.bg} ${defaultColors.text} ${defaultColors.border}`
    }

    export const LANGUAGES = appConfig.languages

    export const LANGUAGE_COLORS: Record<string, string> = Object.entries(appConfig.languageColors).reduce(
      (acc, [key, value]) => {
        acc[key] = `${value.bg} ${value.text} ${value.border}`
        return acc
      },
      {} as Record<string, string>
    )