New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fastify/accept-negotiator

Package Overview
Dependencies
Maintainers
18
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/accept-negotiator - npm Package Compare versions

Comparing version

to
2.0.1

52

package.json
{
"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
[![CI](https://github.com/fastify/accept-negotiator/workflows/CI/badge.svg)](https://github.com/fastify/accept-negotiator/actions/workflows/ci.yml)
[![CI](https://github.com/fastify/accept-negotiator/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/accept-negotiator/actions/workflows/ci.yml)
[![NPM version](https://img.shields.io/npm/v/@fastify/accept-negotiator.svg?style=flat)](https://www.npmjs.com/package/@fastify/accept-negotiator)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](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