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

resolve-accept-language

Package Overview
Dependencies
Maintainers
1
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resolve-accept-language - npm Package Compare versions

Comparing version 1.0.0 to 1.0.2

7

lib/resolve-accept-language.js

@@ -41,5 +41,3 @@ "use strict";

var localeLanguagesByQuality = new language_quality_list_1.default();
var directives = acceptLanguageHeader
.split(',')
.map(function (directive) { return directive.trim(); });
var directives = acceptLanguageHeader.split(',').map(function (directive) { return directive.trim(); });
for (var _i = 0, directives_1 = directives; _i < directives_1.length; _i++) {

@@ -62,4 +60,3 @@ var directive = directives_1[_i];

// If the locale is not supported, but the locale's language is, add to locale language preference.
if (!localeList.locales.includes(locale) &&
localeList.languages.includes(languageCode)) {
if (!localeList.locales.includes(locale) && localeList.languages.includes(languageCode)) {
localeLanguagesByQuality.add(quality, languageCode);

@@ -66,0 +63,0 @@ continue;

{
"name": "resolve-accept-language",
"version": "1.0.0",
"version": "1.0.2",
"description": "Resolve the preferred locale based on the value of an `Accept-Language` HTTP header.",

@@ -5,0 +5,0 @@ "main": "lib/resolve-accept-language.js",

@@ -35,3 +35,3 @@ # resolve-accept-language

One of the main challenge is that BCP47 language tags can be either overly simple or too complex. This is one of the problem this
One of the main challenge is that BCP 47 language tags can be either overly simple or too complex. This is one of the problem this
library will try to address by focusing on locales identifier using the `language`-`country` format instead of trying to provide

@@ -52,4 +52,4 @@ full BCP 47 language tags support. The main reasons for this:

1. Try exact BCP 47 locale code match.
2. Try the language code match from the HTTP header, related to the BCP47 locale codes specified.
2. Try the language code match from the HTTP header, related to the BCP 47 locale codes specified.
3. As a last resort, extract the languages from the specified locales and check if there is a match with the header's locales.
4. Uses the specified default locale.
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