Backend half
This commit is contained in:
+1
-2
@@ -1,7 +1,6 @@
|
||||
1.0.0 / 2024-08-31
|
||||
unreleased
|
||||
==================
|
||||
|
||||
* Drop support for node <18
|
||||
* Added an option preferred encodings array #59
|
||||
|
||||
0.6.3 / 2022-01-22
|
||||
|
||||
+2
-2
@@ -172,7 +172,7 @@ Returns the most preferred encoding from the client.
|
||||
|
||||
Returns the most preferred encoding from a list of available encodings.
|
||||
|
||||
##### encoding(availableEncodings, { preferred })
|
||||
##### encoding(availableEncodings, preferred)
|
||||
|
||||
Returns the most preferred encoding from a list of available encodings, while prioritizing based on `preferred` array between same-quality encodings.
|
||||
|
||||
@@ -185,7 +185,7 @@ Returns an array of preferred encodings ordered by the client preference.
|
||||
Returns an array of preferred encodings ordered by priority from a list of
|
||||
available encodings.
|
||||
|
||||
##### encodings(availableEncodings, { preferred })
|
||||
##### encodings(availableEncodings, preferred)
|
||||
|
||||
Returns an array of preferred encodings ordered by priority from a list of
|
||||
available encodings, while prioritizing based on `preferred` array between same-quality encodings.
|
||||
|
||||
+4
-5
@@ -44,14 +44,13 @@ Negotiator.prototype.charsets = function charsets(available) {
|
||||
return preferredCharsets(this.request.headers['accept-charset'], available);
|
||||
};
|
||||
|
||||
Negotiator.prototype.encoding = function encoding(available, opts) {
|
||||
var set = this.encodings(available, opts);
|
||||
Negotiator.prototype.encoding = function encoding(available, preferred) {
|
||||
var set = this.encodings(available, preferred);
|
||||
return set && set[0];
|
||||
};
|
||||
|
||||
Negotiator.prototype.encodings = function encodings(available, options) {
|
||||
var opts = options || {};
|
||||
return preferredEncodings(this.request.headers['accept-encoding'], available, opts.preferred);
|
||||
Negotiator.prototype.encodings = function encodings(available, preferred) {
|
||||
return preferredEncodings(this.request.headers['accept-encoding'], available, preferred);
|
||||
};
|
||||
|
||||
Negotiator.prototype.language = function language(available) {
|
||||
|
||||
+1
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "negotiator",
|
||||
"description": "HTTP content negotiation",
|
||||
"version": "1.0.0",
|
||||
"version": "0.6.4",
|
||||
"contributors": [
|
||||
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"Federico Romero <federico.romero@outboxlabs.com>",
|
||||
@@ -36,7 +36,6 @@
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"test": "mocha --reporter spec --check-leaks --bail test/",
|
||||
"test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/",
|
||||
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
||||
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user