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

accept-language

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accept-language - npm Package Compare versions

Comparing version 3.0.15 to 3.0.16

8

Build/Source/AcceptLanguage.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var bcp47 = require("bcp47");
var stable = require("stable");
var AcceptLanguage = (function () {

@@ -88,3 +90,3 @@ function AcceptLanguage() {

function parseAndSortLanguageTags(languagePriorityList) {
return languagePriorityList.split(',').map(function (weightedLanguageRange) {
return stable(languagePriorityList.split(',').map(function (weightedLanguageRange) {
var components = weightedLanguageRange.replace(/\s+/, '').split(';');

@@ -105,3 +107,4 @@ return {

})
.sort(function (a, b) {
// Sort by quality
, function (a, b) {
return b.quality - a.quality;

@@ -144,3 +147,2 @@ });

module.exports.default = create();
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = create();
{
"name": "accept-language",
"version": "3.0.15",
"version": "3.0.16",
"description": "Accept-Language parser for nodejs",

@@ -32,4 +32,5 @@ "main": "Build/Source/AcceptLanguage.js",

"dependencies": {
"bcp47": "^1.1.2"
"bcp47": "^1.1.2",
"stable": "^0.1.6"
}
}

@@ -33,3 +33,3 @@ accept-language [![Build Status](https://travis-ci.org/tinganho/node-accept-language.png)](https://travis-ci.org/tinganho/node-accept-language)

#### acceptLanguage.languages(Array languageTags);
Define your language tags ordered in highest priority comes first fashion. The first language will act as a default language in case of no match. The language tags must comply with [BCP47][] standard.
Define your language tags ordered in highest priority comes first fashion. The language tags must comply with [BCP47][] standard.

@@ -41,3 +41,3 @@ ```javascript

#### acceptLanguage.get(String acceptLanguageString);
Get a matched language given an `Accept-Language` string. In case of no match, the default language or `null` will be returned.
Get the most likely language given an `Accept-Language` string. In order for it to work you must set all your languages first.
```javascript

@@ -44,0 +44,0 @@ acceptLanguage.get('en-GB,en;q=0.8,sv');

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