projects
/
squeep-api-dingus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lint cleanup
[squeep-api-dingus]
/
lib
/
content-negotiation.js
diff --git
a/lib/content-negotiation.js
b/lib/content-negotiation.js
index 1425852ffa30925646bfcbc4809bb79d23c308ae..440137448895b393fe2d7dc0903d9086a60347a9 100644
(file)
--- a/
lib/content-negotiation.js
+++ b/
lib/content-negotiation.js
@@
-20,7
+20,7
@@
class ContentNegotiation {
if (type) {
let weight = 1.0;
params = params.reduce((acc, param) => {
if (type) {
let weight = 1.0;
params = params.reduce((acc, param) => {
- const [p, v] = common.splitFirst(param, '=').map((x) => x
&& x
.trim());
+ const [p, v] = common.splitFirst(param, '=').map((x) => x
?
.trim());
if (p && v) {
if (p === 'q') {
weight = Number(v);
if (p && v) {
if (p === 'q') {
weight = Number(v);
@@
-47,7
+47,9
@@
class ContentNegotiation {
* @param {string} acceptHeader
*/
static _acceptClauses(acceptHeader) {
* @param {string} acceptHeader
*/
static _acceptClauses(acceptHeader) {
- const clauses = (acceptHeader||'').split(',').map((clause) => ContentNegotiation._unpackAcceptClause(clause)).filter((clause) => clause);
+ const clauses = (acceptHeader||'').split(',')
+ .map((clause) => ContentNegotiation._unpackAcceptClause(clause))
+ .filter((clause) => clause);
return clauses.sort((a, b) => b.weight - a.weight);
}
return clauses.sort((a, b) => b.weight - a.weight);
}