"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/lcid/index.js" (8 Mar 2017, 436 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

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