New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

accept-language-parser

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accept-language-parser - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

index.js

@@ -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');

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