Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tinyhttp/res

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinyhttp/res - npm Package Compare versions

Comparing version 1.2.5 to 1.2.6

4

dist/append.d.ts
/// <reference types="node" />
import { ServerResponse as S } from 'http';
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;
declare type Res = Pick<S, 'getHeader' | 'setHeader'>;
export declare const append: <Response_1 extends Res = Res>(res: Response_1) => (field: string, value: string | number | string[]) => Response_1;
export {};
/// <reference types="node" />
import { ServerResponse as S } from 'http';
import * as cookie from '@tinyhttp/cookie';
export declare const setCookie: <Request_1 extends unknown = any, Response_1 extends Pick<S, "setHeader" | "getHeader"> = Pick<S, "setHeader" | "getHeader">>(req: Request_1 & {
declare type Res = Pick<S, 'setHeader' | 'getHeader'>;
export declare const setCookie: <Request_1 extends unknown = any, Response_1 extends Res = Res>(req: Request_1 & {
secret?: string | string[];

@@ -9,2 +10,3 @@ }, res: Response_1) => (name: string, value: string | Record<string, unknown>, options?: cookie.SerializeOptions & Partial<{

}>) => Response_1;
export declare const clearCookie: <Request_1 extends unknown = any, Response_1 extends Pick<S, "setHeader" | "getHeader"> = Pick<S, "setHeader" | "getHeader">>(req: Request_1, res: Response_1) => (name: string, options?: cookie.SerializeOptions) => Response_1;
export declare const clearCookie: <Request_1 extends unknown = any, Response_1 extends Res = Res>(req: Request_1, res: Response_1) => (name: string, options?: cookie.SerializeOptions) => Response_1;
export {};

@@ -8,5 +8,6 @@ /// <reference types="node" />

declare type Callback = (err?: any) => void;
declare type Req = Pick<I, 'headers'>;
declare type Res = Pick<S, 'setHeader' | 'statusCode' | 'writeHead'> & NodeJS.WritableStream;
export declare const download: <Request_1 extends Pick<I, "headers"> = Pick<I, "headers">, Response_1 extends Res = Res>(req: Request_1, res: Response_1) => (path: string, filename?: string | Callback, options?: DownloadOptions | Callback, cb?: Callback) => Response_1;
export declare const download: <Request_1 extends Req = Req, Response_1 extends Res = Res>(req: Request_1, res: Response_1) => (path: string, filename?: string | Callback, options?: DownloadOptions | Callback, cb?: Callback) => Response_1;
export declare const attachment: <Response_1 extends Pick<S, "setHeader" | "getHeader"> = Pick<S, "setHeader" | "getHeader">>(res: Response_1) => (filename?: string) => Response_1;
export {};
/// <reference types="node" />
import { IncomingMessage as I, ServerResponse as S } from 'http';
import { IncomingMessage as I } from 'http';
import type { Res } from './redirect';
export declare type FormatProps = {

@@ -12,3 +13,4 @@ default?: () => void;

declare type next = (err?: FormatError) => void;
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;
declare type Req = Pick<I, 'headers'>;
export declare const formatResponse: <Request_1 extends Req = Req, Response_1 extends Res = Res, Next extends next = next>(req: Request_1, res: Response_1, next: Next) => (obj: FormatProps) => Response_1;
export {};
/// <reference types="node" />
import { IncomingMessage as I, ServerResponse as S } from 'http';
export declare const setHeader: <Response_1 extends Pick<S, "setHeader" | "getHeader"> = Pick<S, "setHeader" | "getHeader">>(res: Response_1) => (field: string | Record<string, string | number | string[]>, val?: string | number | readonly string[]) => Response_1;
export declare const setLocationHeader: <Request_1 extends Pick<I, "headers"> = Pick<I, "headers">, Response_1 extends Pick<S, "setHeader" | "getHeader"> = Pick<S, "setHeader" | "getHeader">>(req: Request_1, res: Response_1) => (url: string) => Response_1;
export declare const getResponseHeader: <Response_1 extends Pick<S, "setHeader" | "getHeader"> = Pick<S, "setHeader" | "getHeader">>(res: Response_1) => (field: string) => string | number | string[];
export declare const setLinksHeader: <Response_1 extends Pick<S, "setHeader" | "getHeader"> = Pick<S, "setHeader" | "getHeader">>(res: Response_1) => (links: {
declare type Res = Pick<S, 'setHeader' | 'getHeader'>;
declare type Req = Pick<I, 'headers'>;
export declare const setHeader: <Response_1 extends Res = Res>(res: Response_1) => (field: string | Record<string, string | number | string[]>, val?: string | number | readonly string[]) => Response_1;
export declare const setLocationHeader: <Request_1 extends Req = Req, Response_1 extends Res = Res>(req: Request_1, res: Response_1) => (url: string) => Response_1;
export declare const getResponseHeader: <Response_1 extends Res = Res>(res: Response_1) => (field: string) => string | number | string[];
export declare const setLinksHeader: <Response_1 extends Res = Res>(res: Response_1) => (links: {
[key: string]: string;
}) => Response_1;
export declare const setVaryHeader: <Response_1 extends Pick<S, "setHeader" | "getHeader"> = Pick<S, "setHeader" | "getHeader">>(res: Response_1) => (field: string) => Response_1;
export declare const setContentType: <Response_1 extends Pick<S, "setHeader" | "getHeader"> = Pick<S, "setHeader" | "getHeader">>(res: Response_1) => (type: string) => Response_1;
export declare const setVaryHeader: <Response_1 extends Res = Res>(res: Response_1) => (field: string) => Response_1;
export declare const setContentType: <Response_1 extends Res = Res>(res: Response_1) => (type: string) => Response_1;
export {};
/// <reference types="node" />
import { IncomingMessage as I, ServerResponse as S } from 'http';
declare type Req = Pick<I, 'headers' | 'method'>;
export declare type Res = Pick<S, 'setHeader' | 'statusCode' | 'getHeader' | 'end'>;
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, "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 declare const redirect: <Request_1 extends Req = Req, Response_1 extends Res = Res, Next extends next = next>(req: Request_1, res: Response_1, next: Next) => (url: string, status?: number) => Response_1;
export {};
{
"name": "@tinyhttp/res",
"version": "1.2.5",
"version": "1.2.6",
"type": "module",

@@ -45,3 +45,3 @@ "description": "response extensions for tinyhttp",

"@tinyhttp/req": "1.2.1",
"@tinyhttp/send": "1.2.2",
"@tinyhttp/send": "1.2.3",
"es-mime-types": "^0.0.16",

@@ -48,0 +48,0 @@ "es-vary": "^0.0.8",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc