@tinyhttp/res
Advanced tools
Comparing version 1.1.3 to 1.1.4
/// <reference types="node" /> | ||
import { ServerResponse as S } from 'http'; | ||
export declare const append: <Response_1 extends Pick<S, "getHeader" | "setHeader"> = Pick<S, "getHeader" | "setHeader">>(res: Response_1) => (field: string, value: string | number | string[]) => Response_1; | ||
export declare const append: <Response_1 extends Pick<S, "setHeader" | "getHeader"> = Pick<S, "setHeader" | "getHeader">>(res: Response_1) => (field: string, value: string | number | string[]) => Response_1; |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -12,3 +12,3 @@ /// <reference types="node" /> | ||
declare type next = (err?: FormatError) => void; | ||
export declare const formatResponse: <Request_1 extends Pick<I, "headers"> = Pick<I, "headers">, Response_1 extends Pick<S, "statusCode" | "setHeader" | "getHeader" | "end"> = Pick<S, "statusCode" | "setHeader" | "getHeader" | "end">, Next extends next = next>(req: Request_1, res: Response_1, next: Next) => (obj: FormatProps) => Response_1; | ||
export declare const formatResponse: <Request_1 extends Pick<I, "headers"> = Pick<I, "headers">, Response_1 extends Pick<S, "setHeader" | "getHeader" | "statusCode" | "end"> = Pick<S, "setHeader" | "getHeader" | "statusCode" | "end">, Next extends next = next>(req: Request_1, res: Response_1, next: Next) => (obj: FormatProps) => Response_1; | ||
export {}; |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -0,0 +0,0 @@ export * from '@tinyhttp/send'; |
@@ -200,9 +200,5 @@ import { sendFile } from '@tinyhttp/send'; | ||
// merge user-provided options | ||
opts = Object.create(opts); | ||
opts.headers = headers; | ||
// Resolve the full path for sendFile | ||
const fullPath = resolve(path); | ||
const noop = () => undefined; | ||
opts = { ...opts, headers }; | ||
// send file | ||
return sendFile(res)(fullPath, opts, done || noop); | ||
return sendFile(res)(resolve(path), opts, done || (() => undefined)); | ||
}; | ||
@@ -209,0 +205,0 @@ const attachment = (res) => (filename) => { |
@@ -5,3 +5,3 @@ /// <reference types="node" /> | ||
declare type next = (err?: any) => void; | ||
export declare const redirect: <Request_1 extends Pick<I, "headers" | "method"> = Pick<I, "headers" | "method">, Response_1 extends Pick<S, "statusCode" | "setHeader" | "getHeader" | "end"> = Pick<S, "statusCode" | "setHeader" | "getHeader" | "end">, Next extends next = next>(req: Request_1, res: Response_1, next: Next) => (url: string, status?: number) => Response_1; | ||
export declare const redirect: <Request_1 extends Pick<I, "headers" | "method"> = Pick<I, "headers" | "method">, Response_1 extends Pick<S, "setHeader" | "getHeader" | "statusCode" | "end"> = Pick<S, "setHeader" | "getHeader" | "statusCode" | "end">, Next extends next = next>(req: Request_1, res: Response_1, next: Next) => (url: string, status?: number) => Response_1; | ||
export {}; |
@@ -0,0 +0,0 @@ export declare const normalizeType: (type: string) => { |
{ | ||
"name": "@tinyhttp/res", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "response extensions for tinyhttp", |
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
22833
507