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

resolve-accept-language

Package Overview
Dependencies
Maintainers
1
Versions
174
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.1.52 to 1.1.53

8

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

@@ -42,4 +42,4 @@ "keywords": [

"@types/jest": "29.5.1",
"@typescript-eslint/eslint-plugin": "5.59.0",
"@typescript-eslint/parser": "5.59.0",
"@typescript-eslint/eslint-plugin": "5.59.1",
"@typescript-eslint/parser": "5.59.1",
"dotenv-cli": "7.2.1",

@@ -61,3 +61,3 @@ "eslint": "8.39.0",

"prettier-plugin-sh": "0.12.8",
"release-it": "15.10.1",
"release-it": "15.10.2",
"ts-jest": "29.1.0",

@@ -64,0 +64,0 @@ "ts-node": "10.9.1",

@@ -72,4 +72,3 @@ # resolve-accept-language

As per RFC 4647, this package uses the "lookup" matching scheme. This means that it will always produce exactly one match for a
given request.
As per RFC 4647, this package uses the "lookup" matching scheme. This means that it will always produce exactly one match for a given request.

@@ -81,10 +80,6 @@ The matching strategy will use the following logic:

3. Three different matching patterns (based on the HTTP header's quality factor and order of the provided locales):
1. If there were any matches, get the highest-ranked (quality factor) locale or language code:
1. **Locale-based match**: Is the highest-ranked a locale? If yes, this is the best match.
2. **Language-based match**: Otherwise, find the first locale that matches the highest-ranked language.
2. **Related-locale-based match**: If there is no match, find the first locale with a language that matches the highest-ranked language of locales that were not in scope. This is a bit of a "fuzzy match", but the presumption is that it's better to show content in a language that can be understood even if the country is wrong.
4. When using `resolveAcceptLanguage` return the default locale as a last resort option.

@@ -91,0 +86,0 @@

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