Aktueller Stand
This commit is contained in:
10
backend/node_modules/@fastify/accept-negotiator/README.md
generated
vendored
10
backend/node_modules/@fastify/accept-negotiator/README.md
generated
vendored
@@ -1,11 +1,11 @@
|
||||
# @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.
|
||||
|
||||
### Install
|
||||
```
|
||||
@@ -14,7 +14,7 @@ npm i @fastify/accept-negotiator
|
||||
|
||||
### Usage
|
||||
|
||||
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:
|
||||
|
||||
```
|
||||
negotiate(header, supportedValues)
|
||||
@@ -29,7 +29,7 @@ const encoding = negotiate('gzip, deflate, br', ['br'])
|
||||
console.log(encoding) // 'br*
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
|
||||
```
|
||||
|
||||
58
backend/node_modules/@fastify/accept-negotiator/package.json
generated
vendored
58
backend/node_modules/@fastify/accept-negotiator/package.json
generated
vendored
@@ -1,21 +1,17 @@
|
||||
{
|
||||
"name": "@fastify/accept-negotiator",
|
||||
"version": "1.1.0",
|
||||
"version": "2.0.1",
|
||||
"description": "a negotiator for the accept-headers",
|
||||
"type": "commonjs",
|
||||
"main": "index.js",
|
||||
"types": "types/index.d.ts",
|
||||
"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": [
|
||||
"encoding",
|
||||
"negotiator",
|
||||
@@ -30,16 +26,35 @@
|
||||
"index.js",
|
||||
"types/index.d.ts"
|
||||
],
|
||||
"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.0.0",
|
||||
"tap": "^16.3.0",
|
||||
"tsd": "^0.24.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
"c8": "^10.1.2",
|
||||
"eslint": "^9.17.0",
|
||||
"neostandard": "^0.12.0",
|
||||
"tsd": "^0.31.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -47,5 +62,16 @@
|
||||
},
|
||||
"bugs": {
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
8
backend/node_modules/@fastify/accept-negotiator/types/index.d.ts
generated
vendored
8
backend/node_modules/@fastify/accept-negotiator/types/index.d.ts
generated
vendored
@@ -5,13 +5,13 @@ type NegotiateFn = typeof negotiate
|
||||
declare namespace negotiate {
|
||||
export class Negotiator<K extends string = string> {
|
||||
constructor (options: { supportedValues: K[]; cache?: CacheStore })
|
||||
|
||||
negotiate(header: string): K | null
|
||||
|
||||
negotiate (header: string): K | null
|
||||
}
|
||||
|
||||
export const negotiate: NegotiateFn
|
||||
export { negotiate as default }
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user