2 const invertKv = require('invert-kv');
3 const all = require('./lcid.json');
5 const inverted = invertKv(all);
7 exports.from = lcidCode => {
8 if (typeof lcidCode !== 'number') {
9 throw new TypeError('Expected a number');
12 return inverted[lcidCode];
15 exports.to = localeId => {
16 if (typeof localeId !== 'string') {
17 throw new TypeError('Expected a string');