diff --git a/lib/constants.js b/lib/constants.js index 5deebb3..9056fbc 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -233,6 +233,8 @@ export const LANGUAGES = [ } ] +export const LANGUAGE_HASH = toHash(LANGUAGES) + export const DEFAULT_LANGUAGE = { name: 'Auto' } export const COLORS = { @@ -261,3 +263,13 @@ if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') { } }) } + +function toHash (list) { + return list.reduce((accum, item) => { + if (item.module) { + accum[item.module] = item + } + + return accum + }, {}) +} \ No newline at end of file