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.13 to 1.0.14

2

lib/locale-list.d.ts

@@ -14,3 +14,3 @@ import Locale from './locale';

*
* @param locales An array of locale identifiers using the `language`-`country` format.
* @param locales - An array of locale identifiers using the `language`-`country` format.
*

@@ -17,0 +17,0 @@ * @throws Will throw an error if one of the locale's format is invalid.

@@ -8,3 +8,3 @@ "use strict";

*
* @param locales An array of locale identifiers using the `language`-`country` format.
* @param locales - An array of locale identifiers using the `language`-`country` format.
*

@@ -11,0 +11,0 @@ * @throws Will throw an error if one of the locale's format is invalid.

@@ -11,4 +11,4 @@ export default class Locale {

*
* @param identifier A locale identifier using the `language`-`country` format.
* @param caseSensitive Is the case of the string sensitive? (`true` by default)
* @param identifier - A locale identifier using the `language`-`country` format.
* @param caseSensitive - Is the case of the string sensitive? (`true` by default)
*/

@@ -19,4 +19,4 @@ static isLocale(identifier: string, caseSensitive?: boolean): boolean;

*
* @param languageCode An ISO 639-1 alpha-2 language code.
* @param caseSensitive Is the case of the string sensitive? (`true` by default)
* @param languageCode - An ISO 639-1 alpha-2 language code.
* @param caseSensitive - Is the case of the string sensitive? (`true` by default)
*/

@@ -27,4 +27,4 @@ static isLanguageCode(languageCode: string, caseSensitive?: boolean): boolean;

*
* @param countryCode An ISO 3166-1 alpha-2 country code.
* @param caseSensitive Is the case of the string sensitive? (`true` by default)
* @param countryCode - An ISO 3166-1 alpha-2 country code.
* @param caseSensitive - Is the case of the string sensitive? (`true` by default)
*/

@@ -35,3 +35,3 @@ static isCountryCode(countryCode: string, caseSensitive?: boolean): boolean;

*
* @param identifier A locale identifier using the `language`-`country` format.
* @param identifier - A locale identifier using the `language`-`country` format.
*

@@ -38,0 +38,0 @@ * @throws Will throw an error if the locale format is invalid.

@@ -7,3 +7,3 @@ "use strict";

*
* @param identifier A locale identifier using the `language`-`country` format.
* @param identifier - A locale identifier using the `language`-`country` format.
*

@@ -24,4 +24,4 @@ * @throws Will throw an error if the locale format is invalid.

*
* @param identifier A locale identifier using the `language`-`country` format.
* @param caseSensitive Is the case of the string sensitive? (`true` by default)
* @param identifier - A locale identifier using the `language`-`country` format.
* @param caseSensitive - Is the case of the string sensitive? (`true` by default)
*/

@@ -36,4 +36,4 @@ Locale.isLocale = function (identifier, caseSensitive) {

*
* @param languageCode An ISO 639-1 alpha-2 language code.
* @param caseSensitive Is the case of the string sensitive? (`true` by default)
* @param languageCode - An ISO 639-1 alpha-2 language code.
* @param caseSensitive - Is the case of the string sensitive? (`true` by default)
*/

@@ -48,4 +48,4 @@ Locale.isLanguageCode = function (languageCode, caseSensitive) {

*
* @param countryCode An ISO 3166-1 alpha-2 country code.
* @param caseSensitive Is the case of the string sensitive? (`true` by default)
* @param countryCode - An ISO 3166-1 alpha-2 country code.
* @param caseSensitive - Is the case of the string sensitive? (`true` by default)
*/

@@ -52,0 +52,0 @@ Locale.isCountryCode = function (countryCode, caseSensitive) {

@@ -13,4 +13,4 @@ import Locale from './locale';

*
* @param quality The HTTP quality factor associated with a locale.
* @param identifier A locale identifier using the `language`-`country` format.
* @param quality - The HTTP quality factor associated with a locale.
* @param identifier - A locale identifier using the `language`-`country` format.
*/

@@ -21,4 +21,4 @@ addLocale(quality: string, identifier: string): void;

*
* @param quality The HTTP quality factor associated with a language.
* @param languageCode An ISO 639-1 alpha-2 language code.
* @param quality - The HTTP quality factor associated with a language.
* @param languageCode - An ISO 639-1 alpha-2 language code.
*/

@@ -29,4 +29,4 @@ addLanguage(quality: string, languageCode: string): void;

*
* @param quality The HTTP quality factor associated with an unsupported locale's language.
* @param languageCode An ISO 639-1 alpha-2 language code.
* @param quality - The HTTP quality factor associated with an unsupported locale's language.
* @param languageCode - An ISO 639-1 alpha-2 language code.
*/

@@ -37,4 +37,4 @@ addUnsupportedLocaleLanguage(quality: string, languageCode: string): void;

*
* @param localeList The list of locale from which the top language can be selected.
* @param defaultLocale The default locale object when no match is found.
* @param localeList - The list of locale from which the top language can be selected.
* @param defaultLocale - The default locale object when no match is found.
*

@@ -41,0 +41,0 @@ * @returns The best match when found, otherwise the default locale identifier.

@@ -16,4 +16,4 @@ "use strict";

*
* @param quality The HTTP quality factor associated with a locale.
* @param identifier A locale identifier using the `language`-`country` format.
* @param quality - The HTTP quality factor associated with a locale.
* @param identifier - A locale identifier using the `language`-`country` format.
*/

@@ -32,4 +32,4 @@ LookupList.prototype.addLocale = function (quality, identifier) {

*
* @param quality The HTTP quality factor associated with a language.
* @param languageCode An ISO 639-1 alpha-2 language code.
* @param quality - The HTTP quality factor associated with a language.
* @param languageCode - An ISO 639-1 alpha-2 language code.
*/

@@ -48,4 +48,4 @@ LookupList.prototype.addLanguage = function (quality, languageCode) {

*
* @param quality The HTTP quality factor associated with an unsupported locale's language.
* @param languageCode An ISO 639-1 alpha-2 language code.
* @param quality - The HTTP quality factor associated with an unsupported locale's language.
* @param languageCode - An ISO 639-1 alpha-2 language code.
*/

@@ -64,4 +64,4 @@ LookupList.prototype.addUnsupportedLocaleLanguage = function (quality, languageCode) {

*
* @param localeList The list of locale from which the top language can be selected.
* @param defaultLocale The default locale object when no match is found.
* @param localeList - The list of locale from which the top language can be selected.
* @param defaultLocale - The default locale object when no match is found.
*

@@ -68,0 +68,0 @@ * @returns The best match when found, otherwise the default locale identifier.

/**
* Resolve the preferred locale from an HTTP `Accept-Language` header.
*
* @param acceptLanguageHeader The value of an HTTP request `Accept-Language` header (also known as a "language priority list").
* @param supportedLocales An array of locale identifiers (`language`-`country`). It must include the default locale.
* @param defaultLocale The default locale (`language`-`country`) when no match is found.
* @param acceptLanguageHeader - The value of an HTTP request `Accept-Language` header (also known as a "language priority list").
* @param supportedLocales - An array of locale identifiers (`language`-`country`). It must include the default locale.
* @param defaultLocale - The default locale (`language`-`country`) when no match is found.
*

@@ -8,0 +8,0 @@ * @returns The preferred locale identifier following the BCP 47 `language`-`country` (case-normalized) format.

@@ -9,5 +9,5 @@ "use strict";

*
* @param acceptLanguageHeader The value of an HTTP request `Accept-Language` header (also known as a "language priority list").
* @param supportedLocales An array of locale identifiers (`language`-`country`). It must include the default locale.
* @param defaultLocale The default locale (`language`-`country`) when no match is found.
* @param acceptLanguageHeader - The value of an HTTP request `Accept-Language` header (also known as a "language priority list").
* @param supportedLocales - An array of locale identifiers (`language`-`country`). It must include the default locale.
* @param defaultLocale - The default locale (`language`-`country`) when no match is found.
*

@@ -74,4 +74,4 @@ * @returns The preferred locale identifier following the BCP 47 `language`-`country` (case-normalized) format.

*
* @param directiveMatch Regex match result for an `Accept-Language` header directive.
* @param defaultLocaleObject The default locale object used to normalize the result.
* @param directiveMatch - Regex match result for an `Accept-Language` header directive.
* @param defaultLocaleObject - The default locale object used to normalize the result.
*

@@ -78,0 +78,0 @@ * @returns Parsed results from a matched `Accept-Language` header directive or `null` when there is no match.

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

@@ -44,10 +44,10 @@ "main": "lib/resolve-accept-language.js",

"@types/jest": "^26.0.22",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/parser": "^4.21.0",
"eslint": "^7.24.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-jest": "^24.3.4",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"eslint": "^7.25.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^24.3.5",
"jest": "^26.6.3",
"prettier": "2.2.1",
"ts-jest": "^26.5.4",
"ts-jest": "^26.5.5",
"ts-node": "^9.1.1",

@@ -54,0 +54,0 @@ "typescript": "^4.2.4"

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