Front end of the Slack clone application.

index.js 436B

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