Socket
Socket
Sign inDemoInstall

country-locale-map

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

country-locale-map - npm Package Compare versions

Comparing version 1.6.1 to 1.7.0

countries-intl.json

10

index.js
const fuzz = require('fuzzball');
function CLM() {
var clm = {};
var countries = require('./countries.json');
var countries;
console.log(process.env.CLM_MODE);
if(process && process.env && process.env.CLM_MODE == 'INTL') {
countries = require('./countries-intl.json');
} else {
countries = require('./countries.json');
}
var countryByAlpha2Code = {};

@@ -7,0 +15,0 @@ var countryByAlpha3Code = {};

2

package.json
{
"name": "country-locale-map",
"version": "1.6.1",
"version": "1.7.0",
"description": "Provides mapping between country codes and provides default country locals. Includes optional fuzzy matching for country name.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -12,2 +12,6 @@ # Country Locale Map [![Build Status](https://travis-ci.com/atnmorrison/country-locale-map.svg?branch=master)](https://travis-ci.com/atnmorrison/country-locale-map)

If you would like locales to be returned with - instead of_ you can set an environment variable
CLM_MODE='INTL' in a .env file using [dotenv](https://www.npmjs.com/package/dotenv) just make sure that dotenv is required before requiring the country local map library
## Functions

@@ -14,0 +18,0 @@

/* eslint-env node, mocha */
const chai = require('chai');
const expect = chai.expect;
process.env.CLM_MODE = undefined;
delete require.cache[require.resolve('../index.js')];
const clm = require('../index.js');

@@ -229,2 +233,7 @@

it('getLocaleByName should return zh_CN if passed in China', function(){
let result = clm.getLocaleByName('China', true);
expect(result).to.equal('zh_CN');
});
})

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc