@fastify/accept-negotiator
Advanced tools
Comparing version
{ | ||
"name": "@fastify/accept-negotiator", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "a negotiator for the accept-headers", | ||
@@ -9,12 +9,8 @@ "type": "commonjs", | ||
"scripts": { | ||
"lint": "standard index.js test/* benchmarks/*", | ||
"lint": "eslint", | ||
"lint:fix": "eslint --fix", | ||
"test": "npm run test:unit && npm run test:typescript", | ||
"test:unit": "tap", | ||
"test:unit": "c8 --100 node --test", | ||
"test:typescript": "tsd" | ||
}, | ||
"standard": { | ||
"ignore": [ | ||
"index.d.ts" | ||
] | ||
}, | ||
"keywords": [ | ||
@@ -34,9 +30,30 @@ "encoding", | ||
], | ||
"author": "Aras Abbasi", | ||
"author": "Aras Abbasi <aras.abbasi@gmail.com>", | ||
"contributors": [ | ||
{ | ||
"name": "Matteo Collina", | ||
"email": "hello@matteocollina.com" | ||
}, | ||
{ | ||
"name": "Manuel Spigolon", | ||
"email": "behemoth89@gmail.com" | ||
}, | ||
{ | ||
"name": "James Sumners", | ||
"url": "https://james.sumners.info" | ||
}, | ||
{ | ||
"name": "Frazer Smith", | ||
"email": "frazer.dev@icloud.com", | ||
"url": "https://github.com/fdawgs" | ||
} | ||
], | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@fastify/pre-commit": "^2.1.0", | ||
"@matteo.collina/tspl": "^0.1.1", | ||
"benchmark": "2.1.4", | ||
"standard": "17.1.0", | ||
"tap": "^18.7.2", | ||
"c8": "^10.1.2", | ||
"eslint": "^9.17.0", | ||
"neostandard": "^0.12.0", | ||
"tsd": "^0.31.0" | ||
@@ -50,3 +67,14 @@ }, | ||
"url": "https://github.com/fastify/accept-negotiator/issues" | ||
} | ||
}, | ||
"homepage": "https://github.com/fastify/accept-negotiator#readme", | ||
"funding": [ | ||
{ | ||
"type": "github", | ||
"url": "https://github.com/sponsors/fastify" | ||
}, | ||
{ | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/fastify" | ||
} | ||
] | ||
} |
# @fastify/accept-negotiator | ||
[](https://github.com/fastify/accept-negotiator/actions/workflows/ci.yml) | ||
[](https://github.com/fastify/accept-negotiator/actions/workflows/ci.yml) | ||
[](https://www.npmjs.com/package/@fastify/accept-negotiator) | ||
[](https://standardjs.com/) | ||
[](https://github.com/neostandard/neostandard) | ||
A negotiator for the accept-headers | ||
A negotiator for accept-* headers. | ||
@@ -17,3 +17,3 @@ ### Install | ||
The module exports a function that you can use for negotiating an accept-header, e.g. accept-encoding. It takes 2 parameters: | ||
The module exports a function that you can use for negotiating an accept-* header such as [`accept-encoding`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding). It takes 2 parameters: | ||
@@ -33,3 +33,3 @@ ``` | ||
The module also exports a class that you can use for negotiating an accept-header, e.g. accept-encoding, and use caching for better performance. | ||
The module also exports a class that you can use for negotiating an accept-* header, and use caching for better performance. | ||
@@ -36,0 +36,0 @@ |
@@ -8,4 +8,4 @@ type CacheStore = { set: (key: string, value: string) => CacheStore, get: (key: string) => string | undefined, has: (key: string) => boolean } | ||
constructor (options: { supportedValues: K[]; cache?: CacheStore }) | ||
negotiate(header: string): K | null | ||
negotiate (header: string): K | null | ||
} | ||
@@ -17,3 +17,3 @@ | ||
declare function negotiate<K extends string = string>(header: string, supportedValues: K[]): K | null; | ||
export = negotiate; | ||
declare function negotiate<K extends string = string> (header: string, supportedValues: K[]): K | null | ||
export = negotiate |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
9029
10.18%0
-100%7
40%1
Infinity%