@tinyhttp/accepts
Advanced tools
Comparing version 0.5.1 to 0.5.2
# @tinyhttp/accepts | ||
## 0.5.2 | ||
### Patch Changes | ||
- make types more flexible | ||
## 0.5.1 | ||
@@ -4,0 +10,0 @@ |
/// <reference types="node" /> | ||
import Negotiator from 'negotiator'; | ||
import { IncomingMessage, IncomingHttpHeaders } from 'http'; | ||
import { IncomingMessage as I, IncomingHttpHeaders } from 'http'; | ||
export declare class Accepts { | ||
headers: IncomingHttpHeaders; | ||
negotiator: Negotiator; | ||
constructor(req: IncomingMessage); | ||
constructor(req: Pick<I, 'headers'>); | ||
/** | ||
@@ -9,0 +9,0 @@ * Check if the given `type(s)` is acceptable, returning the best match when true, otherwise `false`, in which case you should respond with 406 "Not Acceptable". |
{ | ||
"name": "@tinyhttp/accepts", | ||
"description": "accepts rewrite in TypeScript with ESM and CommonJS targets", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"homepage": "https://github.com/talentlessguy/tinyhttp#readme", | ||
@@ -6,0 +6,0 @@ "repository": { |
import Negotiator from 'negotiator' | ||
import { IncomingMessage, IncomingHttpHeaders } from 'http' | ||
import { IncomingMessage as I, IncomingHttpHeaders } from 'http' | ||
import { lookup } from 'es-mime-types' | ||
@@ -12,3 +12,3 @@ | ||
negotiator: Negotiator | ||
constructor(req: IncomingMessage) { | ||
constructor(req: Pick<I, 'headers'>) { | ||
this.headers = req.headers | ||
@@ -15,0 +15,0 @@ this.negotiator = new Negotiator(req) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20952