2 var invertKv = require('invert-kv');
3 var all = require('./lcid.json');
4 var inverted = invertKv(all);
6 exports.from = function (lcidCode) {
7 if (typeof lcidCode !== 'number') {
8 throw new TypeError('Expected a number');
11 return inverted[lcidCode];
14 exports.to = function (localeId) {
15 if (typeof localeId !== 'string') {
16 throw new TypeError('Expected a string');