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.1 to 1.2.3

6

dist/download.d.ts
/// <reference types="node" />
import { ServerResponse as S } from 'http';
import { IncomingMessage as I, ServerResponse as S } from 'http';
import type { SendFileOptions } from '@tinyhttp/send';

@@ -8,5 +8,5 @@ export declare type DownloadOptions = SendFileOptions & Partial<{

declare type Callback = (err?: any) => void;
declare type Res = Pick<S, 'setHeader'> & NodeJS.WritableStream;
export declare const download: <Response_1 extends Res = Res>(res: Response_1) => (path: string, filename?: string | Callback, options?: DownloadOptions | Callback, cb?: Callback) => Response_1;
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 attachment: <Response_1 extends Pick<S, "setHeader" | "getHeader"> = Pick<S, "setHeader" | "getHeader">>(res: Response_1) => (filename?: string) => Response_1;
export {};

@@ -175,3 +175,3 @@ import { sendFile } from '@tinyhttp/send';

const download = (res) => (path, filename, options, cb) => {
const download = (req, res) => (path, filename, options, cb) => {
let done = cb;

@@ -203,3 +203,3 @@ let name = filename;

// send file
return sendFile(res)(opts.root ? path : resolve(path), opts, done || (() => undefined));
return sendFile(req, res)(opts.root ? path : resolve(path), opts, done || (() => undefined));
};

@@ -206,0 +206,0 @@ const attachment = (res) => (filename) => {

{
"name": "@tinyhttp/res",
"version": "1.2.1",
"version": "1.2.3",
"type": "module",

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

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

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

Sorry, the diff of this file is not supported yet

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