@lengoo/locales-normalizer
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
109467
5
6669
1
2