Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lengoo/locales-normalizer

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lengoo/locales-normalizer - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

test/index.test.js

8

index.js

@@ -11,4 +11,6 @@ const languages = require('./languages');

if (code.includes(separator)) {
const [left, right] = code.split(separator);
return `${left.toLowerCase()}-${right.toUpperCase()}`;
const [left, right, suffix] = code.split(separator);
return suffix
? `${left.toLowerCase()}-${right.toUpperCase()}-${suffix.toUpperCase()}`
: `${left.toLowerCase()}-${right.toUpperCase()}`;
}

@@ -22,3 +24,3 @@ }

function getLanguage(code) {
return languages.find(language => language.code === normalize(code));
return languages.find(language => normalize(language.code) === normalize(code));
}

@@ -25,0 +27,0 @@ module.exports = {

{
"name": "@lengoo/locales-normalizer",
"version": "1.0.0",
"version": "1.0.1",
"description": "Small project for normalizing locale codes across different standards.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha"
},

@@ -13,3 +13,3 @@ "repository": {

},
"author": "Cesar Bretana Gonzalez <bretanac@gmail.com>",
"author": "Cesar Bretana Gonzalez <cesar.bretana@lengoo.de>",
"license": "MIT",

@@ -19,3 +19,7 @@ "bugs": {

},
"homepage": "https://github.com/lengoo/locale-normalizer#readme"
"homepage": "https://github.com/lengoo/locale-normalizer#readme",
"devDependencies": {
"chai": "^4.2.0",
"mocha": "^6.2.2"
}
}
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