Newer
Older
CVSS_3.0_GUI / dist / CVSS_3.0_Calc-1.0.0-linux-x64 / node_modules / nwjs-builder-phoenix / node_modules / yargs / node_modules / os-locale / node_modules / lcid / index.js
root on 7 May 2019 436 bytes Initial commit
  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;
Buy Me A Coffee