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 2.0.22 to 2.0.23

4

dist/download.d.ts
/// <reference types="node" />
import { IncomingMessage as Req, ServerResponse as Res } from 'http';
import type { SendFileOptions } from '@tinyhttp/send';
export declare type DownloadOptions = SendFileOptions & Partial<{
export type DownloadOptions = SendFileOptions & Partial<{
headers: Record<string, string>;
}>;
declare type Callback = (err?: any) => void;
type Callback = (err?: any) => void;
export declare const download: <Request_1 extends Req = Req, Response_1 extends Res<Req> = Res<Req>>(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 Res<Req>>(res: Response_1) => (filename?: string) => Response_1;
export {};
/// <reference types="node" />
import { IncomingMessage as Req, ServerResponse as Res } from 'http';
export declare type FormatProps = {
export type FormatProps = {
default?: () => void;
} & Record<string, any>;
export declare type FormatError = Error & {
export type FormatError = Error & {
status: number;

@@ -11,4 +11,4 @@ statusCode: number;

};
declare type next = (err?: FormatError) => void;
type next = (err?: FormatError) => void;
export declare const formatResponse: <Request_1 extends Req = Req, Response_1 extends Res<Req> = Res<Req>, Next extends next = next>(req: Request_1, res: Response_1, next: Next) => (obj: FormatProps) => Response_1;
export {};

@@ -91,3 +91,3 @@ import { sendFile } from "@tinyhttp/send";

const clearCookie = (req, res) => (name, options) => {
return setCookie(req, res)(name, "", Object.assign({}, { expires: new Date(1), path: "/" }, options));
return setCookie(req, res)(name, "", Object.assign({}, { expires: /* @__PURE__ */ new Date(1), path: "/" }, options));
};

@@ -94,0 +94,0 @@ const normalizeType = (type) => ~type.indexOf("/") ? acceptParams(type) : { value: mime.lookup(type), params: {} };

/// <reference types="node" />
import { IncomingMessage as Req, ServerResponse as Res } from 'http';
declare type next = (err?: any) => void;
type next = (err?: any) => void;
export declare const redirect: <Request_1 extends Req = Req, Response_1 extends Res<Req> = Res<Req>, Next extends next = next>(req: Request_1, res: Response_1, next: Next) => (url: string, status?: number) => Response_1;
export {};

@@ -1,2 +0,2 @@

export declare type NormalizedType = {
export type NormalizedType = {
value: string;

@@ -3,0 +3,0 @@ quality?: number;

{
"name": "@tinyhttp/res",
"version": "2.0.22",
"version": "2.0.23",
"type": "module",

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

"dependencies": {
"@tinyhttp/content-disposition": "2.0.8",
"es-escape-html": "^0.1.1",
"es-mime-types": "^0.1.4",
"es-vary": "^0.1.2",
"@tinyhttp/content-disposition": "2.0.9",
"@tinyhttp/cookie": "2.0.6",

@@ -34,6 +37,3 @@ "@tinyhttp/cookie-signature": "2.0.6",

"@tinyhttp/req": "2.0.16",
"@tinyhttp/send": "2.0.8",
"es-escape-html": "^0.1.1",
"es-mime-types": "^0.1.4",
"es-vary": "^0.1.2"
"@tinyhttp/send": "2.0.8"
},

@@ -40,0 +40,0 @@ "scripts": {

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