accept-language-parser
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -44,3 +44,3 @@ var regex = /((([a-zA-Z]+(-[a-zA-Z]+)?)|\*)(;q=[0-1](\.[0-9]+)?)?)*/g; | ||
for (var j = 0; j < supported.length; j++) { | ||
if (lang.code === supported[j].code && lang.region === supported[j].region) { | ||
if (lang.code === supported[j].code && (!lang.region || lang.region === supported[j].region)) { | ||
return supportedLanguages[j]; | ||
@@ -47,0 +47,0 @@ } |
{ | ||
"name": "accept-language-parser", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Parse the accept-language header from a HTTP request", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -86,2 +86,7 @@ var parser = require("../index.js"); | ||
it('should pick a language when culture is not specified', function() { | ||
var result = parser.pick(['en-us', 'it-IT'], 'pl-PL,en'); | ||
assert.equal(result, 'en-us'); | ||
}); | ||
it('should return null if no matches are found', function(){ | ||
@@ -88,0 +93,0 @@ var result = parser.pick(['ko-KR'], 'fr-CA,fr;q=0.8,en-US;q=0.6,en;q=0.4,*;q=0.1'); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
10809
162
0