@tinyhttp/req
Advanced tools
Comparing version 0.1.0 to 0.1.1
# @tinyhttp/req | ||
## 0.1.1 | ||
### Patch Changes | ||
- minor fixes | ||
## 0.1.0 | ||
@@ -4,0 +10,0 @@ |
import { IncomingMessage as Request, ServerResponse as Response } from 'http'; | ||
import parseRange, { Options } from 'range-parser'; | ||
export declare const getRequestHeader: (req: Request) => (header: string) => string | string[]; | ||
export declare const setRequestHeader: (req: Request) => (field: string, value: string) => string; | ||
export declare const getRangeFromHeader: (req: Request) => (size: number, options?: Options) => -1 | -2 | parseRange.Ranges; | ||
@@ -6,0 +5,0 @@ export declare const getFreshOrStale: (req: Request, res: Response) => boolean; |
@@ -15,5 +15,2 @@ import parseRange from 'range-parser'; | ||
}; | ||
const setRequestHeader = (req) => (field, value) => { | ||
return (req.headers[field.toLowerCase()] = value); | ||
}; | ||
const getRangeFromHeader = (req) => (size, options) => { | ||
@@ -48,2 +45,2 @@ const range = getRequestHeader(req)('Range'); | ||
export { checkIfXMLHttpRequest, getAccepts, getFreshOrStale, getRangeFromHeader, getRequestHeader, setRequestHeader }; | ||
export { checkIfXMLHttpRequest, getAccepts, getFreshOrStale, getRangeFromHeader, getRequestHeader }; |
{ | ||
"name": "@tinyhttp/req", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "request extensions for tinyhttp", |
@@ -18,6 +18,2 @@ import { IncomingMessage as Request, ServerResponse as Response } from 'http' | ||
export const setRequestHeader = (req: Request) => (field: string, value: string) => { | ||
return (req.headers[field.toLowerCase()] = value) | ||
} | ||
export const getRangeFromHeader = (req: Request) => (size: number, options?: Options) => { | ||
@@ -24,0 +20,0 @@ const range = getRequestHeader(req)('Range') as string |
Sorry, the diff of this file is not supported yet
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
8979
144